LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 1050 by trying to use load'filename' in matlab script node

Solved!
Go to solution

Hi

 

I keep getting error 1050 when Labview tries to load a text file through the matlab script node.

I've all ready checked for it on google and this forum but found nothing. I've also done this: http://digital.ni.com/public.nsf/allkb/2B3FF46C8512C4F786256CF30071BE53 and tried to use dlmread and more. 

 

The thing is that  I need the matlab script node to read a txt file that Labview made from a chart with only 1 array, plot it and export a jpg image. I can't really use the 'export image' or 'get image' function in Labview cause I need the whole plotted chart (these functions only take a snap shot of it when they're run).

 

This is my code that I'm using:

 data=load('file') ;

Vpp=(data(1:2000,1));

xsize = (1/2000);

plot(0.0005:0.0005:1,Vpp);

axis([0 1 -5 5]);

print('-djpeg', 'graph.jpg');

 

The usual load in matlab to load txt files and print to print the jpeg. The code works in matlab but not in labview 🙂

 

And yeah, I'm using windows 7 and legal versions of matlab r2009b and Labview 2009 😉 

0 Kudos
Message 1 of 4
(4,729 Views)
Yes I forgot, this is my error...  It looks like it can't read the file path, but the 'file' path is actually just a path to my c:\user\*\*\*\*.txt 
 
Error 1050 occurred at LabVIEW:  Error occurred while executing script. Error message from server: ??? Error using ==> load
Unable to read file file: No such file or directory.
0 Kudos
Message 2 of 4
(4,723 Views)
Solution
Accepted by topic author smelkur

Hehe, I've figured it out 😛

 

Path must be converted to String and skip the ' around the file.

 

Worked 🙂 

Message 3 of 4
(4,710 Views)
Can you please mark your third post as solution then?
Message Edited by Mathan on 11-30-2009 11:05 AM
0 Kudos
Message 4 of 4
(4,708 Views)