LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting LabVIEW Cluster to MATLAB file format

Hi,

 

I'm in the process of taking a fairly complicated MATLAB program and ideally embedded it within a Mathscript or if we have to, a MATLAB mode within LabVIEW.

 

Getting the code itself embedded has actually been a relatively straightforward task, but where I am having difficulties is how to get the appropriate data into the script node. This is a very easy task with simple data types (i.e. numerics, arrays etc), but the input for this node is quite complex (attached sample pic below) and I'm really not sure how is best to get this into the node. One possibility is to read it in within the node from a .Mat file, but then as we acquire the data in LabVIEW there would still be the task of converting from say a LabVIEW cluster to a .mat format.

 

Any ideas?

 

Untitled.png

 

 

 

 

David Clark
CLA | CTA
IDEX Biometrics UK Ltd
Hampshire, England
0 Kudos
Message 1 of 4
(2,964 Views)

If is were me, I would unbundle the cluster and send it into the MATLAB script node as more basic types and then reassemble it inside. 

 

Data types get tricky with that thing.

 

I can't believe I'm posting this to the forums twice in less than 10  minutes, but you might find this helpful too: Send N-Dimensional Arrays into a MATLAB® Script Node

 

Try a process similar to that for your clusters.

 

<EDIT> Sorry, forgot you were trying to work mostly in MathScript node.  My advice is still the same, though I don't know if those sessions persist (I don't think they do).

Chris
Certified LabVIEW Architect
Certified TestStand Architect
Message 2 of 4
(2,948 Views)

Someone wrote a library to read and write .mat files in LabVIEW: http://matio-labview.sourceforge.net/

(Also see the topic on LAVA: http://lavag.org/topic/10976-a-mat-file-io-library/)

I have not used this library, I just remember seeing the post about it and so am providing a link to it here.

Message 3 of 4
(2,935 Views)

Thanks for the info - I shall have a look.

 

Dave

David Clark
CLA | CTA
IDEX Biometrics UK Ltd
Hampshire, England
0 Kudos
Message 4 of 4
(2,919 Views)