LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MATLAB graphics

Solved!
Go to solution

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.

0 Kudos
Message 1 of 7
(2,715 Views)

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.  

Regards,

Eric L.
Applications Engineering Specialist
National Instruments
0 Kudos
Message 2 of 7
(2,684 Views)

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. 

 

 

 

0 Kudos
Message 3 of 7
(2,671 Views)

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.


Regards,

Eric L.
Applications Engineering Specialist
National Instruments
0 Kudos
Message 4 of 7
(2,648 Views)

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.

 

 

0 Kudos
Message 5 of 7
(2,639 Views)
Solution
Accepted by topic author efarr

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.  

 


Regards,

Eric L.
Applications Engineering Specialist
National Instruments
0 Kudos
Message 6 of 7
(2,630 Views)

That did it! Thanks.

0 Kudos
Message 7 of 7
(2,621 Views)