08-24-2008 11:08 AM
Hello,
I am trying to open a matlab data file created by a third party data logger software, the file extension is *.mat. I plan to use Labview to read the arrays of data and to do further analysis.
Please can you advise on the approach and what functions are required.
Thanks in advance.
Duc
08-24-2008 11:41 AM
.mat file are prorietary and it is not recommended to write your own interface, because the structure could change in the future.
Quote from the matlab help:
"The MAT-file interface library contains routines for reading and writing MAT-files. You can call these routines from your own C and Fortran programs. Use these routines, rather than attempt to write your own code, to perform these operations, since using the library insulates your applications from future changes to the MAT-file structure."
What is your LabVIEW version? Do you also have matlab installed?
08-24-2008 11:45 AM
Hi Duc,
it should be possible with the "MathScript Node". According to the LabVIEW help you can use the "load" function to load your data from the *.mat file.
Hope it helps.
Mike
08-26-2008 02:52 AM
Hi,
The problem is that I don't have Matlab so I assume I can't use the Mathscript Node function? I am using Labview 8.5
Duc
08-26-2008 02:54 AM
Hi Duc,
did you try it? I thought you can use the MathScript node without MATLab. I can´t try because i have no mat file.
Mike
08-26-2008 03:23 AM
Hello Mike,
I have attached the type of mat file I am trying to read. I think it may be in binary format.
Are you able to read it using the Script node?
According the to link below, it talks of a Vi to parse the file.
"Binary Format
Complete the following steps if you want to import or export data between LabVIEW and MATLAB®.
From the MATLAB® environment to LabVIEW
Are there any further details on that section? Its quite brief.
http://digital.ni.com/public.nsf/websearch/2F8ED0F588E06BE1862565A90066E9BA?OpenDocument
Thanks,
Duc
08-26-2008 03:38 AM
08-26-2008 03:44 AM
Hi Mike,
Varible name is "data", I am not too sure of the type.
Duc
08-26-2008 04:15 AM
Hi duc,
you can use the MathScript node. I can read the file, but i can´t see some data. Maybe you can see more. You can also use a probe on the MathScript node to see what was loaded.
Mike
08-26-2008 04:52 AM
Thanks Mike!
Please can you kindly make a print screen of your diagram or attach the Vi, so I can copy it without any problems. This would save me such much time.
Thanks in advance,
Duc