Jump to content

How to call .m file in labview mathscript window


Lodestar

Recommended Posts

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

Link to comment

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.

Link to comment

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 by confidence
Link to comment

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.