07-13-2012 06:40 PM
Hi,
I am using three 1D arrays (frequency, real S11 data and imaginary S22) to send to the MATLAB scipt node inside Labview.
MATLAB script node uses a predesigned MATLAB code to process that data into matrices. I cannot post the code because it's not my own, however the code uses a lot of matrices and all that stuff to process these.
Before checking in Labview, what I did was store these three arrays as three different variables in MATLAB. Then I just ran the code which accepts these variables and gives Q. In such a case, the code worked perfectly fine. However when I use the same data and send it to MATLAB script node in Labview, it says 'Matrix dimensions must agree'
I think it is because when Labview sends that array, it actually has two columns, one is serial number and other is the data, because whenever I opened the write to measurement file, there were always two columns not one which MATLAB needs probably.
Is there a way to remedy this problem?
07-13-2012 07:17 PM
If it is two columns, it is not a 1D array.
MATLAB makes a distinction between row vectors and column vectors, maybe that's the problem.
07-13-2012 08:19 PM
I sorted that out. It was because those 1D arrays were saved as horizontally in rows so I transposed them.
Can you tell me if MATLAB script embedded in Labview modules can call functions?
So far I have not been able to call any and am pasting code all over the place. It always shows errors.
Or which directory does the functions have to be?