Lodestar Posted November 3, 2009 Report Share Posted November 3, 2009 Hi, everybody. I wanna call a .m-file in labview mathscript window. the m-file likes this: %m-file function result=add(a,b) result=a+b; %end when I input "add(1,3)" in command window, but the command window shows "Unknown symbol on line 1: add". How to call a m file which includes the function made by myself? ps: don't use mathscript node, and don't copy the content of the function and paste it into command window. thanks for your help Quote Link to comment
Lodestar Posted November 3, 2009 Author Report Share Posted November 3, 2009 Thanks for your attention, I have solved it. Quote Link to comment
Ton Plomp Posted November 3, 2009 Report Share Posted November 3, 2009 Hi, everybody. I wanna call a .m-file in labview mathscript window. the m-file likes this: How to call a m file which includes the function made by myself? ps: don't use mathscript node, and don't copy the content of the function and paste it into command window. thanks for your help Thanks for your attention, I have solved it. Hi Confidence, could you add your solution? It looks like you were able to solve it quite easy, so sharing that could help many. Ton PS There are no stupid mistakes. Quote Link to comment
Lodestar Posted November 5, 2009 Author Report Share Posted November 5, 2009 (edited) Hi Confidence, could you add your solution? It looks like you were able to solve it quite easy, so sharing that could help many. Ton PS There are no stupid mistakes. Hi Ton, To directly use a user-defined function in the command window of LabVIEW mathscript, for example Add(x,y), someone should make sure he has configured the path of the default folder in which there is your function, namely the .m file with the same name . The reason I can't use my .m file is that after setting the path of .m file searching folder I don't restart Labview. This is because the setting become effect, we have to restart LabVIEW. My solution. Thanks confidence Edited November 5, 2009 by confidence Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.