LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Quick question on functions

I can't seem to find the answer anywhere. What's the syntax to use a function like f(x)?
Thanks
0 Kudos
Message 1 of 2
(6,214 Views)
Hello,

To write a function like you show, you will need to create a .m file on disk.  The default location for .m files is in "My Documents\LabVIEW Data."  The syntax for such a function is
function y = f(x)

The name of the .m file needs to be the same as the function name.  Thus, in this example, save the file as f.m.  After that line, you can implement the body of your function.

In LabVIEW, go to Help >> Search the LabVIEW Help.  On the index tab, type MathScript.  Select the "function syntax" topic for more information about writing your own functions.

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
Message 2 of 2
(6,209 Views)