NI does not actively maintain this document.
This content provides support for older products and technology, so you may notice outdated links or obsolete information about operating systems or other relevant products.
This list is not meant to be comprehensive; it is intended to make you aware of some key issues and to explain how to improve the performance of your code. We are dedicated to improving LabVIEW and MathScript. Patches and/or future releases of LabVIEW might fix or change the status of these documented issues and limitations.
MathScript does not work with extended ASCII characters or localized decimal separators
LabVIEW 8.0 MathScript does not currently support the LabVIEW Application Builder
LabVIEW 8.0 MathScript does not support MEX files (executable .m
file scripts), sparse matrices, arrays with greater than 2 dimensions, cell arrays, or structures
User-defined function names in MathScript are case sensitive
You cannot specify default values for optional parameters in user-defined functions
LabVIEW 8.0 MathScript does not support 'return' and 'end' keywords
You cannot place a MathScript Node directly inside simulation diagrams from the LabVIEW Simulation Module
When you use a linear index on a matrix, LabVIEW returns the output in the same shape as the indices, and the reshape of the matrix incurs computational overhead
The destination for multiple function outputs cannot be an element of a matrix
MathScript does not share global variables between two application instances
Storage of variable state information in a loop imposes computational overhead if performed outside of a MathScript Node
The calendar function does not work if the system date format differs from the U.S. format
x = -1:0.1:1;
results in the error message, "You cannot specify a step size of zero for a range.".m
file scripts), sparse matrices, arrays with greater than 2 dimensions, cell arrays, or structures:A = {magic(3) 6.9 'string'};
a.day = 12;
foo
defined in foo.m
, you must type foo(x)
..m
file scripts expect case insensitivity. Therefore, if you call the function FoO(x)
, the function call does not work. All built-in functions already are case insensitive.nargin
function call to determine which inputs were provided and then assigning values to any missing arguments. LabVIEW 8.0 MathScript does not support the nargin
and nargout
functions. To call a function that is written to use default parameters, you must remove the calls to nargin
and nargout
and always provide all arguments. Because there is no current method to determine how many output arguments were requested, you should compute all outputs.return
keyword used in other third-party math software. LabVIEW 8.0 MathScript also does not support the end
keyword in matrix indexing. The return
keyword is used to break execution and return from a function before reaching the end of the function definition. The following example shows a script that does not work with LabVIEW 8.0 MathScript:function c = foo(a, b)
if a == 2
return;
end
c = 5;
return
statement, set the flag variable to a certain value. Enclose the code following the old return
statement in an if
statement that checks the value of the flag variable.end
keyword in matrix indexing that do not work with LabVIEW 8.0 MathScript:B = A(2:end)
B = C(2:end, 4)
A
is one- or two-dimensional. In the one-dimensional case, you can use the length
function instead of end
, as shown in the following example:B = A(2:length(A))
[m n] = size(A)
B = A(2:m*n)
[m n] = size(C)
B = C(2:m, 4)
A = rand(1000);
B = A(1:2:1000000);
foo
returns two values, you cannot place either of the outputs directly into a subset of a matrix. If you do place the output directly into a subset of a matrix, MathScript returns the error “The current MathScript could not be executed. Please contact National Instruments with the script.” The following line provides an example of this usage that does not work in LabVIEW 8.0 MathScript:[vs(m, n) s] = foo(...)
[a s] = foo(...)
vs(m, n) = a
Refer to the LabVIEW MathScript section of the LabVIEW 8.6 Readme for more information about MathScript known issues in LabVIEW 8.6. You may also search through former LabVIEW version's readme documents for issues in those versions.