Jump to content

How to call .m file in labview mathscript window


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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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