MWArray: Non-conventional-Matlab terminology for data types and arrays?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
As far as I know, and based on the thread "scalar vs matrix vs vector vs array??", a double array in Matlab is an array of type double. A scalar is a single-element array, so the number of dimensions is irrelevant. An array can have any number of dimensions, some of which may have zero size.
MWNumericArray(boolean rVal, boolean iVal, MWClassID classid)
Constructs a complex numeric double array that represents the
primitive boolean arguments.
MWNumericArray(boolean rVal, MWClassID classid)
Constructs a real scalar numeric array that represents the
primitive boolean argument.
MWNumericArray(byte rVal)
Constructs a real scalar numeric array of type MWClassID.INT8
that represents the primitive byte argument.
MWNumericArray(byte rVal, byte iVal)
Constructs a complex scalar numeric array of type
MWClassID.INT8 that represents the primitive byte arguments.
In the first function call, what is meant by "complex numeric double array"? Is it a single-element array, with the 1 element using a double for the real part and a double for the imaginary part? Shouldn't the precision be determined by the "classid" argument?
Unlike the first call, the second function call returns a "real scalar numeric". Why is the word "scalar" used here but not in the first call? Is "scalar" being used differently from Matlab to mean non-complex?
If that is the case, then why is the 4th function call also described as returning "complex scalar numeric array)?
AFTERNOTE: Finding even more undefined terminology as I try to reference the information more. For example, the `getDouble` method sometimes returns a "1-based index-array as a double". The internet doesn't seem to return a meaning for "index-array" in the context of Java. (After much mulling & digging: "Index" probably refers to the purpose of the array rather than how the array is realized. Such an array of length "n" contains the coordinates of a single element in an n-dimensional array)
0 Commenti
Risposta accettata
Todd Flanagan
il 29 Ott 2020
Modificato: Todd Flanagan
il 29 Ott 2020
MWNumericArray(boolean rVal, boolean iVal, MWClassID classid)
This signature will take Java booleans and convert them to classid in MATLAB. There are Java signatures for all of the supported Java types like boolean, int8, double, etc.
boolean r = false;
boolean i = true;
MWNumericArray a = new MWNumericArray(r, i, MWClassID.LOGICAL);
In this case, if classid is "logical", there will be no conversion.
If classid is double, you will get a double array in MATLAB.
boolean r = false;
boolean i = true;
MWNumericArray a = new MWNumericArray(r, i, MWClassID.DOUBLE);
2 Commenti
Todd Flanagan
il 29 Ott 2020
Hi,
I see what you are saying now.
Constructs a complex numeric double array that represents the primitive boolean arguments.
Should read somthing like:
Constructs a complex scaler numeric array that represents the primitive boolean arguments.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Java Package Integration in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!