01-31-2014 10:52 AM
Hi all,
This might be a typical Friday afternoon question, but I've been stuck on this now just about all day and rather close to throwing the laptop out of the window.
The case is as follow
* I've sorted 5 markers in a 4D array whereby I have 5 volumes
* Each volume (marker) contains data 5 datasets in 5 pages
* Each dataset is build out of rows and columns of varying lengths (within 10% of each other) but similar amount of columns.
* Each columns is another measurement channel
The amount of markers and repeats as well as measurement duration of markers is variable.
I'm now trying to automatically average each channel data (column) with the other relevant channel data within one marker.
So, for example, I would like to create an average graph (+ stdev) of channel 1, for each marker.
I have attached an example array for reference, I'm using LabVIEW 11.0.1f (yes I know it's acient!) and would really appreciate your help!
Many thanks
Patrick
Solved! Go to Solution.
01-31-2014 11:09 AM
Can you post an example of how you're doing your indexing?
This should be pretty straightforward.
How do you want the nils handled in your average?
Have you tried indexing columns and running them through the Mean and Std Dev functions?
01-31-2014 11:12 AM
Taki1999 wrote:This should be pretty straightforward.
That's exactly what I thought! But I am struggling with the indexxing of the different levels of this array, hence I'm posting.
I was hoping to remove the nils in order not to let them count towards the average
Patrick
01-31-2014 11:15 AM
Post what you've got.
My guess is that you're missing a transpose or something like that.
01-31-2014 11:16 AM
I would suggest building a second array with the labels of each point (V1-P1-C1-D1, V1-P1-C1-D2, etc. You can do this programatically with string functions), not the points themselves. That way, when you manipulate one, manipulate the other likewise, and you will know what you've done.
Cameron
01-31-2014 11:22 AM
@Taki1999 wrote:
Post what you've got.
My guess is that you're missing a transpose or something like that.
This is what I'm now looking at, not very useful as I just started over, but gives you the general idea
01-31-2014 11:35 AM
Well you have the obvious race condition here.
That cannot be helping you at all!
after that you might just want to peruse the Rube-Goldberg thread over on "Breakpoint" I'd bet kudos that the same thing could be done on a block diagram the size of a postage stamp.
01-31-2014 12:39 PM
Your averaging isn't too far off unless I'm misunderstanding what you're trying to average.
Autoindexing is your friend.
Start by autoindexing on the volume/marker (outermost for loop)
Then autoindex into the page/dataset (1st level nested loop)
Then transpose your data set so that the next level will loop over columns.
Then autoindex into each column.
Strip trailing zeroes and pipe through the Std Deviation and Variance.vi.
Auto index out your results for Std Dev and Mean and you've got a 3-D arrays where first index is marker, 2nd index is dataset, and 3rd is column.