LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mathscript Matlab function calling issues

Solved!
Go to solution

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.

Arnold
0 Kudos
Message 1 of 2
(2,758 Views)
Solution
Accepted by topic author mugger

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

Regards,
Srikrishna


0 Kudos
Message 2 of 2
(2,741 Views)