LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing 1D array data from sound files into matlab

Hi,
 
Im really new to Labview and I just decided to use it for a few simple tasks, but unfortunatély Im about to give up. I cant seem to understand how the arrays are working in labview.
 
I need to read a file, it could be anything e.g. realtime daq or so, and that data has to be put in an array and sent to matlab. When im connecting to the sound read i get the data out as a 1D array and it can be plotted. If I connect that to the matlab script, defining an input as 1d array called X, i would expect all the data from the file being put in X in matlab, but no way...
 
Could anyone tell me what im doing wrong....
 
I have attached a vi file
 
Thanks so much
 
Brian
0 Kudos
Message 1 of 3
(2,706 Views)

Hello Brian,

The data returned from the Sound File Read Simple. VI is in the form of '1D array of Waveforms.' The data type you have selected as the input 'X' in your MATLAB script node is 1D Array of Real. If you wish to read one waveform into the MATLAB script you will first need to index that array of waveforms to be left with a single waveform, and then from that extract the Y values which will then give you the same data type as the MATLAB script node input. See the attached file on how to do this.

Good Luck!

Tom
NIUK

Message Edited by Tom. on 03-22-2007 11:15 AM

0 Kudos
Message 2 of 3
(2,693 Views)
Hi Tom, that is just Great..
 
Cheers
 
Brian
 
 
0 Kudos
Message 3 of 3
(2,688 Views)