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