LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview mathscript structures: load, modify and save

i am using the new mathscript structure feature for data in labview 2011. i have several .mat files created in a binary format comprised of a complex data structure (called PFFT) that entails sampled time data, their FFTs and several sampling parameters. this data structure is much too large and complex to flatten into individual files. Instead, signal analysis proceeds by processing various arrays via matlab, or labview, within the data structure and updating  it.

 

what i like in the recent  LV 2011 support of structures in mathscript is that i can load the original .mat structure quite nicely as a simple load(file). Also the parameters/complex arrays are accessible using the same structured data format as in matlab.

 

my problem is that i want to modify existing elements of the data structure and save it in its entirety to the same file. my limited understanding of matlab/mathscript is to use a save(file) or save (file, 'PFFT") command. However, when i do this the original .mat file is not updated, but is rewritten with a .mat.bak extension. In addition the .mat file that contained the PFFT structure is rewritten and empty without any variables added. I am not a matlab programmer and am trying to avoid processing in matlab. However, at this point i do not know if my difficulty stems from not knowing the proper syntax, or whether its a shortcoming in saving mathscript structures.

 

thanks in advance

0 Kudos
Message 1 of 2
(2,971 Views)

Hi neolung,

 

When modifying/adding/deleting elements from your .mat file, please make sure you are using the correct syntax of the save function. Here is the help page for the save function for reference: http://zone.ni.com/reference/en-XX/help/373123B-01/lvtextmath/msfunc_save/

 

Follow the Example in the page and let me know if it helped!

 

 

Aldo A
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,951 Views)