10-02-2012 11:42 AM
Hi everyone,
I have small speed hump with my vi; hopefully somene can help...?
I have a 2D array that contains 6 signals (strain gauge waveforms). Need to calculate the average waveform across the 6 signals so that I have 1 response (waveform) signal... In matlab I would code it as:
mean_waveform= mean(2D_Array,2);
This has stumped me...? Any help would be greatly appreciated.
Kind regards,
Jack
Solved! Go to Solution.
10-02-2012 11:49 AM - edited 10-02-2012 11:53 AM
Assuming the sampling is synchronized so every waveform in your waveform array has the same dt and start time you could do the following. If they don't have the same acquistion start time, you'd have to set that waveform component manually.
Edit: woops I didn't see you attached a VI and that you have a 2D array of doubles. Just transpose the array then use my second for loop, ignoring the rest of the code I show. That should do it. It will output an 1D array, where each element is the average of the respective column in the 2D array.
10-02-2012 11:50 AM - edited 10-02-2012 11:50 AM
Transpose the array, pass into a FOR loop with a Mean.vi in it.
10-02-2012 11:56 AM
Thanks crossrulz and For(imstuck)...
Very much appreciated...
Regards,
Jack