07-06-2011 01:24 PM - edited 07-06-2011 01:27 PM
Hopefully this question will be trivial to you experienced LabView users.
I would like to create a 2D array where the successive rows of this array are defined by the overlap of the inital 1D arrays. Lets call the two 1D array's: A and B and assume that they have the same size. The first row of the 2D array will have "A" for the first N elements, then the second array "B" will fill in the remaining elements for a total element length of 2N for the first row (the next N elements after 2N should be keyed in as 0, the reason for this is that I plan to overlap A until it is on the other side of B). The second row of the 2D array will begin to overlap the two arrays, essentially the first array will shift one to the right and the last element of the first array will overlap with the first element of the second array. The effective overall length of the second row is now 2N-1, the extra element can be filled up with a 0 in order to keep the array a (3N)x(3N) square. Basically what is going on is that every successive row of the 2D array is shifting the overlap between array "A" and array "B" until array "A" ends up on the other side of array "B".
If we let A+B=C visually what is going on is the following:
AAAAAABBBBBB
AAAAACBBBBB
AAAACCBBBB
...
CCCCCC
...
BBBBBCAAAAA
BBBBBBAAAAAA
What I currently have is both 1D arrays indexed into 64bit doubles. I am not sure how to take these 64bit 1D arrays and produce the 2D array I want.
The end goal is to have a slider that picks out a particular row from the 2D array and plots the entire row essentially showing the overlap between the two 1D arrays. As you move the slider from left to right, you'll see a 'movie' of the two waveforms overlapping in time.
If anything is unclear, unreasonable or "much easier to do this way" please let me know. Thank you!
07-06-2011 02:05 PM
Here is one way to do it:
Allows for different size arrays.
07-06-2011 02:14 PM - edited 07-06-2011 02:15 PM
07-06-2011 02:18 PM
I will try this asap! THNX!!
07-06-2011 02:19 PM
AB: Am I missing something, I do not believe there should be 3N rows in the result. Assuming equal lengths it should be 2N+1.
07-06-2011 02:26 PM
@Darin.K wrote:
AB: Am I missing something, I do not believe there should be 3N rows in the result. Assuming equal lengths it should be 2N+1.
I was going by the "...(3N)x(3N) square..." in the original post, which does not agree with the graphics. Who knows what he really wants. 😄
07-06-2011 02:30 PM
@altenbach wrote:
@Darin.K wrote:
AB: Am I missing something, I do not believe there should be 3N rows in the result. Assuming equal lengths it should be 2N+1.
I was going by the "...(3N)x(3N) square..." in the original post, which does not agree with the graphics. Who knows what he really wants. 😄
Ah. There is a reason that I do not read posts very carefully....
07-06-2011 04:16 PM
My apologies I think that 3Nx3N was wrong
There would be 3N columns but 2N+1 rows
That makes more sense I think, sorry about the confusion. I implemented your diagram, but I'm having trouble with the slider part I was refering to. I think I'm gonna try and see if the array was properly made first.. but that requires writing it to a spreadsheet...and since I'm really new I'm having trouble with that as well haha.
07-06-2011 04:37 PM
@VedranJ wrote:
I think I'm gonna try and see if the array was properly made first.. but that requires writing it to a spreadsheet...and since I'm really new I'm having trouble with that as well haha.
What's wrong with a plain array indicator, or even a graph? 😄
07-06-2011 04:39 PM