As @Andras mentioned in the comments, the procedure to import and use this class is already mentioned in the documentation for the class (though you might be forgiven if you missed it, as it's not on the top part of the page dealing with syntax).
The tl;dr version is that you should either access the class constructor as, e.g.:
D = bioma.data.DataMatrix(...);
or, import the class from the package / namespace first, and then use it directly, i.e.:
import bioma.data.DataMatrix;
D = DataMatrix(...);
Explanation
The reason you need this step in the first place, is because this class is enclosed inside a "package" (a.k.a. a "namespace"). Read the section called "Packages Create Namespaces" in the matlab documentation to find out more what this means.
However, in principle it boils down to the fact that, if you have a folder whose name has a +
prefix, then this acts as a namespace for the functions contained within.
So, if you have a folder called +MyPackage
on your path, and this contains a function m-file called myfunction.m
(but this is not in your path), then you can access this function in the matlab terminal by typing MyPackage.myfunction()
.
Or, you can import MyPackage.myfunction
from that package / namespace and then use myfunction
directly.
So, going back to DataMatrix
, you will see that if you search where the class definition is located in your matlab folder, you'll find it here:
./toolbox/bioinfo/microarray/+bioma/+data/@DataMatrix/DataMatrix.m
and presumably ./toolbox/bioinfo/microarray
is already in your path.
I.e. the bioma
package/namespace is in your path, and you can access the data
package/namespace below it, and then the class definition for DataMatrix
by doing bioma.data.DataMatrix
.
PS: Furthermore, the "@" prefix in front of a folder name denotes a class folder, containing the constructor and class methods. If this "@folder" is in your path (or imported etc), then this means you have access to the underlying constructor. This is a remnant from matlab's old object-oriented style, before the classdef
keyword was introduced. You can read more about class directories here if you're interested.