08-25-2011 08:01 PM
Hi all,
Below is a picture of what I am trying to do: Basically, I want to select the A (3x3) subarray, manipulate the corresponding data, then
select the B (2x2) subarray, manipulate the corresponding data, then finally select the C (4x4) subarray, and manipulate its corresponding
data. In my real problem, I have more than just A, B, C. I could have any number of variables.
I do have a 1D array as well, shown below, which I use to do some kind of matching with my 2D array so I can select the appropriate subarray.
Please see the attached VI, and see if my approach makes sense. To be concrete, the final output of my VI should be a 2D array containig
A, B, C and for each variable, I want the total sum of all numbers corresponding to that subarray.
For example for A, I want 1+2+2+2+1+5. My actual data manipulation would be more complicated, but if I can figure out this simple case,
the actual case will follow.
I just don't know where to store each subbarray in my for loop and WHEN to do my data manipulation, should it be inside the inner for loop, outside, where? See the attached VI.
Thanks in advance.
Solved! Go to Solution.
08-25-2011 08:19 PM
Sorry, I don't have LV 2011. Can you down-convert to 8.X. Thanks.
08-26-2011 09:40 AM
See attached. Thanks
08-26-2011 10:11 AM
I'm not sure if I understood what you're asking for, but I think the attached example will do what you want.
08-26-2011 10:14 AM
I think you need some initialization and to wire through the false case.
Note that the output is a three dimensional array. Because the pages cannot be different sizes, the "A" and "B" pages contain some blank elements. If not match is found fo an element in 1D array, an entire page will be blank. To see this replace "B" in 1D array with "D".
To do your summation a String to number conversion followed by Array Sum works well.
Lynn
08-26-2011 11:41 AM
Thank you very much Johnsold!
It worked exactly like I wanted to.
I really appreciate your help, and all those other volunteers who put their time into helping others. This is just great.