06-03-2012 05:18 PM
I'm updating code from LV6.1 to LV2011 that generates MATLAB graphics. When I run bare VIs, the code works fine. But when I build an app, I start getting all sorts of errors of the form
Error 1050: Undefined function altplt (one of my MATLAB .M files) for input arguments of type 'double'.
The message makes is hard to understand because 1) I have already cast the inputs into single precision; 2) altplt should work fine with arguments of type 'double'; and 3) the code works fine when just running VIs
Does anyone have any ideas? Thanks.
Solved! Go to Solution.
06-04-2012 12:58 PM
Hey efarr,
How are you generating your graphics in LabVIEW? Are you using a MATLAB script node? Do you know which lines in your code are generating the error? It would be very helpful to see what this code does in order to determine why this is happening.
06-05-2012 12:24 AM
Eric,
I've attached all the relevant files. I compressed them in Windows 7. Sorry there are so many.
If you run MatlabPlotScript.vi as a bare VI, you'll get a nice Matlab graph with the preloaded data. I've added popup error messages, and it runs without error.
If you build an app, in this case named PlotTest.exe, you'll still get a nice graph, but there will be errors.The error message is
Error 1050: Undefined function AltPlt (one of my MATLAB .M files) for input arguments of type 'double'.
For the particular preloaded data, I can ignore the errors. But other cases acutully fail to plot.
Thanks for your help.
06-05-2012 05:15 PM
Hey Efarr,
I have ran Plot Test.exe from the LabVIEW 2011 Environment and was able to run it fine, the graph appeared and no error occurred. What version of MATLAB is your .m file that you are calling?
MATLAB® is a registered trademark of The MathWorks, Inc.
06-06-2012 12:11 AM
Eric,
That's surprising. I'm using MATLAB 2012A version 7.14. I think that's the most current version.
In the attached files, I changed the default input data to generate a polar plot. In this case, I get a similar error, but one that complains about polarhg instead of AltPlt. But this one won't even plot when run from the executable.
Could you please try running the executable and see if it plots OK and if errors are generated? Maybe a more severe test will tell us something.
06-06-2012 05:02 PM
Hey Efarr,
Try this: In MATLAB select File»Set Path... from the pull-down menu. Select Add Path... and add the path where your function scripts are located to the MATLAB search path. So in this case just add the entire Plot Test file and its sub folders. This cleared the problem up for me, let me know how it works for you.
06-06-2012 08:28 PM
That did it! Thanks.