LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to call a function in "matlab script"

Hellow!
I am using Matlab scrip to make some matlab program in Labview,but i find when i try to call a matlab function like"myfun.m",it will ouput error message"undefined command myfun. So what should i do to call function in matlab script? thanks!
0 Kudos
Message 1 of 5
(3,644 Views)
Happybird,

Do you have MATLAB installed on the computer?  LabVIEW makes calls to MATLAB to run the script node.  If so, make sure that you have launched MATLAB and then launch LabVIEW.  Once you have tried that, <a href="http://digital.ni.com/public.nsf/websearch/4475BC3CEB062C9586256D750058F14B?OpenDocument">KB 300A6NDT</a> might be helpful.  Hope this information helps!

Andy F.
-----------------------------------------------------------------
National Instruments
0 Kudos
Message 2 of 5
(3,635 Views)

My apologies, that link did not come through as it was supposed to.  Here it is again:

http://forums.ni.com/ni/board/message?board.id=170&message.id=135485

 

-----------------------------------------------------------------
National Instruments
0 Kudos
Message 3 of 5
(3,631 Views)
Yes,the matlab 7.1 sevice pack 2 is installed on the computer,and i did not have any problem when use matlab for this program.
0 Kudos
Message 4 of 5
(3,623 Views)
So you are able to implement the same function by calling it using .m files in MATLAB?  LabVIEW makes ActiveX calls to MATLAB to get the communication to work, so if you are able to call the function in MATLAB you should be able to use it in LabVIEW.  I also might recommend making sure that you have the .m file in the correct path, or that you have assigned the path for that file in MATLAB.

Andy F.
-----------------------------------------------------------------
National Instruments
0 Kudos
Message 5 of 5
(3,586 Views)