LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use 1-D array of waveform in Matlab Script

Solved!
Go to solution

I am using Lavbiew to do Vibration signal classification.

 

The first problem I met is the wrong data form.

 

The signals out are 1D arrary of waveform. I dont know how to use it in Matlab Script.

 

does anybody can help me about this?

 

I really appreciate your help.

 

 

0 Kudos
Message 1 of 4
(3,331 Views)
Solution
Accepted by topic author beauzhang

Hey beauzhang,

 

I hope you're well today. It definitely looks like we're running into some issues with different source and sink data types. The Load from LVM Express VI you have is outputting an array of waveforms. So we'd need to do a couple things. First we'll need to abstract the array of interest, and then we need to get the array of data components from the waveform.

 

I've provided you an example of how we can extract the waveform in the 0th position of the array and then pass its array of Y data values to the script node. I've configured the input of the data node to be a 1-D Array of Reals (by adding an Input and then rightclicking that input and selecting Choose Data Type.

 

If you're interested in getting the individual Y values and building the array like you've done in the script, you would need to implement another array subset and a looping mechanism in the LabVIEW code to pass each element to the script individually. However, I would recommend working with the Array input instead.

 

bpimage.PNG

 

Hope this helps!

 

 

 

Tim A.
Message 2 of 4
(3,305 Views)

hi,TimothyA,

 

thank you very much,

 

It works very well.

 

and I finished my VI

0 Kudos
Message 3 of 4
(3,285 Views)

That's great! Glad you got it working.

 

If you ever have any more questions don't hesitate to create another thread. Cat Happy

Tim A.
0 Kudos
Message 4 of 4
(3,281 Views)