Showing results for 
Search instead for 
Did you mean: 

Matlab script node: error 1050 with some commands


I am trying to use the "Matlab script node" in my LabVIEW program.
I want to open a *.mat file and to export one of its variable as an Excel spreadsheet.

When I open my *.mat file by writing in the "Matlab script node" the full path of my file, it works. (ex: "load C:\test_matlab\11bf8200.mat").

But when I try to do it with a path directory box, it crashed and I have a error #1050.
(ex: I ask for the path of my file and after I use the command "load path")

I don't know why my program is crashing like that and I didn't find on this forum an answer for the error #1050 (because in all other case, my "Matlab script node" works !).
I enclose a screenshot of my program with the working and non-working command in my "Matlab script node".

If somebody has an idea, it could be great.

Thanks, Meach

p.s. : LabVIEW version: 8.20
         Matlab version: (R2008a)

Message Edited by Meach on 06-25-2008 03:29 PM
Message 1 of 3
Hi Meach,

The first thing is to make sure that if the MATLAB® Script Node is trying to open any files, make sure that the current MATLAB® directory is set to the directory where the file is located.

If you have verified this, I also want to know what your "path out" and filename "string" indicators are reading from your block diagram screenshot, and if they are the same as the filename and path that you are explicitly entering for the case that works.


Stephen S.
National Instruments
Applications Engineering
0 Kudos
Message 2 of 3
Hi Stephen,

After a lot of try I finally solve my problem.

My "path 2" control is reading the full path of my
MATLAB® file, including the name of the file (without any spaces in the names of directories or file)
            ex:          C:/matlab_test/11bf82000.mat

I convert it into string to use it after in the MATLAB® Script Node, in case of my path generated by the "path 2" control isn't well understand like a string by the MATLAB® Script Node.
Then the only change I done in my last command is that I insert a line at the beginning of the
MATLAB® Script Node, to use a variable, where will be stored the string containing the path of my file ("C:/matlab_test/11bf82000.mat").
Now it is working well and there was just little difference of syntax between the real MATLAB®  command syntax (like removing some ' or things like that).

I enclose a new screenshot of my program if you want to have a look.

Thanks, Meach
0 Kudos
Message 3 of 3