From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.


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

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,
Ingénieur d'applications
National Instruments France
Message 2 of 3
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.
0 Kudos
Message 3 of 3