12-22-2010 02:54 PM
I have a question regarding calling m-script function (MATLAB) in Mathscript Labivew 2009. I enclosed my buggy vi for an example:
1. I called a function "reshape(Sigma0, [O O Q M])" in Mathscript, it gave me a Syntax errror, but not in Matlab R2009b. I guess it doesn't tolerate many ways of parameters input. Any idea that how to use reshape function in Mathscript?
2. Another issue is that I defined one function in m-script with 2 parameters, in Matlab I can call the function with only one parameter provided, however in Mathscript, system will report error if I only provided 1 parameter to a function of 2 parameters. Any idea that how to deal with this issue?
Because I have a lot of code in m-script format, I don't wanna rewrite a lot of code again.
Thanks for any help.
Solved! Go to Solution.
12-23-2010 06:12 AM
Hi mugger,
Indeed there is a small difference in the matlab reshape function and labview mathscript reshape function.The difference is that Matlab always considers any 2-d array in the rows-perspective..where as LabView considers in the columns perspective...i.e if a 2-D array likeX=[a b;c d] is there and the reshape(x,1,4) in labview will give output as a,c,b,d in an array ,in matlab the output will be as a,b,c,d in an array.
And in Labview the syntax you have given will definitely gives an syntax error.Please refer the help in labview about the syntax.
Thanks and regards,
srikrishnaNF