LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to open a .MAT file in LABVIEW

Hey everyone,

 

I currently have a .MAT image file which I would like to open in LABVIEW to apply some image filters. However, I am unsure as to how to open the .MAT file in LABVIEW. Ideally I would like to be able to open the .MAT file without using matlab, and it seems the only way to accomplish this task is through the mathscript node. I have attached an example of the image im trying to open, as well as the LABVIEW program which I would like to use on the image. Thanks for the feedback! =]

0 Kudos
Message 1 of 15
(16,895 Views)

Hi Boiler,

 

1) Do you have a choice in the format you export your data from MATLAB?

 

"ASCII Format
Complete the following steps if you want to import or export data between LabVIEW and the MATLAB® environment, the process is straightforward as long as you are using ASCII format.

From the MATLAB® environment to LabVIEW

  1. To save a vector or a matrix Xin ASCII format with tab delimiter, enter the following in the command window or m-script file in the MATLAB® environment:   
    >>SAVE filename X   -ascii -double -tabs
        This creates a file whose name is filename, and it contains the data X in ASCII format with a tab delimiter.
  2. Import the file into LabVIEW using the Read From Spreadsheet File VI located on the Programming»File I/O palette.

"

 

2) Have you tried using the mathscript node? Did you get any errors?

 

"Binary Format
Complete the following steps if you want to import or export data between LabVIEW and MATLAB®.

From the MATLAB® environment to LabVIEW

  1. To read a .mat file in LabVIEW would require a VI to parse the file. This may be easier if each variable is saved to a separate file.

" -- this was done here, no ideas if it still works,

I want to read a Matlab MAT file into labview

 

Hope this helps, James

 

 

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 2 of 15
(16,872 Views)
You may want to check out this site, http://matio-labview.sourceforge.net/. I believe there are VIs for saving and importing .mat files. Cheers, Andrew
Message 3 of 15
(16,866 Views)

Hi,

 

yes, that is true, and the project is still alive (the installation may take some time, it is compiled with LabVIEW 8.2.1.

If you do not have LV 11 and newer you have to install the RT engine 11 or newer.

I recommend to install the package with the third party "VI Package Manager"

http://jki.net/vipm

 

The "VI Package Manager" takes care about some dependencies with other packages, but it is not solving

all dependencies (you may read the read me file 😉 )

 

At the moment I have the problem to write continually to a 2D double array, but I'm still struggling with this,

has anyone tried this?

 

Stefan

0 Kudos
Message 4 of 15
(16,252 Views)

My problem is that i have faulty bearing signals data file in .mat format, which i want to process in Lab Veiw 2009...I wanted to use Matlab script for the purpose... i am weak in using Matlab, Can any body help me in coding for reading the file and then displaying signals of bearing vibration  in chart...

Regards

0 Kudos
Message 5 of 15
(16,135 Views)

Do you want to analyze in LabVIEW?   TherIsis a datafinder plug-in that will work with e datafinder toolkit.  

 

https://www.ni.com/en/support/downloads/dataplugins/download.ni-dataplugin-for-matlab--mat-files.htm...

 

How big is the .mat file?  Can you work with TDMS files version 2.0

 

 

Preston Johnson
Solutions Manager, Industrial IoT: Condition Monitoring and Predictive Analytics
cbt
512 431 2371
preston.johnson@cbtechinc
0 Kudos
Message 6 of 15
(16,131 Views)

The MATLAB DataPlugin will allow you to

- read/write MATLAB files with LabVIEW using the Storage VIs

- index MATLAB files and search for them using the NI LabVIEW DataFinder Toolkit  

 

0 Kudos
Message 7 of 15
(16,102 Views)

I've the same problem. If someone found out how to do, pls do reply. I've tried the MATLAB® DataPlugin but its not getting installed. Is it possible to use the mathscript node and load a variable from the file?

0 Kudos
Message 8 of 15
(14,075 Views)

Which LabVIEW version are you using?

Did you install your MATLAB dataPlugin from MATLAB® DataPlugin?

Do you have Administrator privileges?

 

0 Kudos
Message 9 of 15
(14,060 Views)
I'm using labview2010 and I'm the admin. Its showing the version of plugin got expired. I uninstalled and installed again. Still the same error is showing.
0 Kudos
Message 10 of 15
(14,049 Views)