From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why Does My MATLAB Script Return Error 1048?

I am running Matlab 6.5, and the matlab scrip is

M_thred2=M > Thred;

M is 2 dimensional array and Thred is a constant, so M_thred2 will have thresholded array from M.
If I make M as output, it works fine, but M_thred2 doesn't.
0 Kudos
Message 1 of 3
(2,339 Views)
Hi,

This error can occur if your variable name is the same as a function name in MATLAB. For instance, using the variable name disp and then trying to return this variable will generate this error. To fix this, choose variable names that are not reserved names used by MATLAB. See the MATLAB online help or user manual for a list of reserved function names.

This error can also be generated if the Clear All function is used in your MATLAB script. To resolve the error, simply remove this function from your script. For more information on creating and using MATLAB scripts in LabVIEW, refer to LabVIEW's VI, Function, & How-To Help.


Hope this helps,
Isabelle
Ingénieur d'applications
National Instruments France
Message 2 of 3
(2,336 Views)
Thanks for the reply, but it looks like another redundant answer.
As you can see, my codes don't have any reserved variable nor "clear" command.
Actually I solved the problem accidentally.

M_thred2=M > Thred;
M_thred2=M_thred2 * 1;

I don't know how Matlab treat variable inside but M_thred2*1 made the difference.
Thanks
kevin
0 Kudos
Message 3 of 3
(2,325 Views)