LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How execute MATLAB'S m-files from Labview and import the information obtained from m-file

Hello!
My question is how i can execute from labview an existing matlab's m-file and then import to labview the information (for example data's arrays) obtained from m-file.
 
Thank you!Smiley Happy
0 Kudos
Message 1 of 2
(3,276 Views)
Hello,

The attached image shows how to use the Matlab script node to send LabVIEW data to Matlab, run some Matlab code, and get data back.

Whatever Matlab commands you put in the Matlab script node is as if you were typing it in the Matlab command window, so it is quite simple.  So, if you have a Matlab script you want to run, you could need to add "cd" commands to change to the appropriate directory.

However, I have had problems when using this, since errors in the Matlab code are not reported, and go completely un-noticed, which is very annoying.  You even get apparently valid values from the outputs of the script node, when in reality they are invalid because there was a run error in the Matlab code.

So, you need to create and COMPLETELY debug your Matlab script in Matlab, where you are able to see errors, and then start using it from LabVIEW.

Good luck,

Alejandro
Message 2 of 2
(3,270 Views)