07-17-2013 09:58 AM
Hi all,
There seem to be an issue with 3 dimensional 'zeros' method in the mathscript module?
The documentation from Matlab gives the following example:
Create a 2-by-3-by-4 array of zeros.
X = zeros(2,3,4); size(X)
ans =
2 3 4
However, in LabVIEW I get a broken arrow:
Is this some known limitation in the mathscript module or perhaps a bug?
Best regards,
/Roger
Solved! Go to Solution.
07-17-2013 10:02 AM - edited 07-17-2013 10:02 AM
01-28-2018 01:37 PM - edited 01-28-2018 01:38 PM
How is this an acceptable answer? I thought part of Mathscript draw was that it could interpret and execute most MATLAB code that didn't use external toolboxes and such.
zeros(i,j,k) is a pretty straight forward function. Not supporting it makes me wonder what other rudimentary functions aren't supported in Mathscript...and I'm VERY pro LabVIEW for a lot of things that MATLAB is equally (or more) capable of...
01-28-2018 01:55 PM - edited 01-28-2018 01:58 PM
Mathscript != Matlab, but it shares similar syntax and will be able to run most plain matlab code (i.e. no special tooolkits, etc). Mathscript datatypes are limited to scalar, 1D, and 2D arrays, as documented e.g. here). The nice thing is that it runs on any LabVIEW or LabVIEW real-time target.
There are other programming tools that use matlab-like syntax, e.g. octave, scilab, etc.
IMHO, Mathscript is for quick incorporation of e.g. legacy matlab code into a LabVIEW program. If you try to write code from scratch, I strongly recommend pure graphical code. It will be much more efficient and flexible.
You can also use the matlab script node, of course, but that requires a matlab license (which you might already have). I think there are also ways to create a dll from within matlab, which can then be called from LabVIEW, of course.
01-28-2018 02:01 PM
I know Mathscript is distinct in implementation from MATLAB, I'm just really surprised at the limitation of data types...i.e. no 3D structures. I guess the limitations have never been explained to me, and I've never run into issues since MOST of my code is native LabVIEW, but a colleague writes a lot in MATLAB and I figured most generic non-toolbox specific code would work.
Don't get me started on MATLAB DLLs...that is a disaster in and of itself...