08-14-2015 06:22 PM - edited 08-14-2015 06:32 PM
I have a MATLAB m-file as follows:
testfcn.m
function [A,B] = testfcn(C)
A = log10(C);
B = C.^2;
How can I call this function testFcn from a MATLAB Script in LabVIEW? See pleaseHelpMeMakeItWork.vi for an illustration of the problem. The attached vi x`attempts to run
Attempted Script Node Code
It does not work. I get
So, ehrm, what the heck here? For context here is the code location on my machine -
This testfcn() works just fine in MATLAB, see example_working.m. But like, how to use it in LabVIEW?
Attachments
Important Context
The answer 'just cut and paste your sub-routine into the script, no function calls needed' doesn't count either... 🙂
08-14-2015 07:09 PM
An anwser may be here -
MathScript Nugget #10: How To Call User-Defined Functions
But from what I see here this requires MATLAB RT (Real-Time), so this does not apply as a generic solution?
08-14-2015 07:20 PM
08-15-2015 03:30 PM
Keep in mind, you're essentially saying "See! My m-file exists right here! It exists! How can LabVIEW not see it!?" What steps have you taken to help LabVIEW see where it is saved on your machine?
08-01-2019 03:13 PM
Hi
Some kind of late answer.
You need to add the path of the function in the matlab script.
Add this on top of your matlab script:
path(path, 'function's path');