ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read Matlab (1024 x 768) matrix (type=double) into mathscript node

I am having extreme difficulty trying to perform a very simple operation. I need to read in a 1024x768 Matrix (type double) called "a1" from Matlab using the mathscript node and then output a1 from the node and display it as a matrix in Labview. The matrix file is save as 'C:\users\Tim\VIs\a1.mat'. This should be a very simple operation, but I cannot get Labview to read in the matrix properly. You're help is greatly appreciate. Here is a copy of the VI and a copy of the matrix file I am trying to read in.
0 Kudos
Message 1 of 2
(2,703 Views)

The Mathscript node isn't the same as Matlab. Mathscript is NI's version of a Matlab-like scripting language. The load function in Mathscript is limited to reading .mat files that have written using Matlab version 6 or earlier. This is detailed in the Help. What version of Matlab did you use? If you have a newer version of Matlab then you can save the data in another format, such as simple text. Then you can use the simple File I/O functions to read it into LabVIEW. There may be also be a .mat file reader floating around. I know I wrote one a while ago (and had posted it), but it was for an older version of the .mat file format.

0 Kudos
Message 2 of 2
(2,679 Views)