01-05-2020 03:01 PM - edited 01-05-2020 03:06 PM
Hi Friends,
I wanted to use replace array subset in my sample VI, replacing array A's second and third columns with array B. I tried 3 ways to do it, respectively as described below: I would like to know why the second and the third ways did not work?
1. Delete array A's second and third columns followed by inserting array B into the resulting array A, which worked as shown in output array 1.
2. Use a for loop with an index array followed by replacing array subset, it did not work properly, only the last column was replaced as shown in output array 2.
3. Transpose the array B and then use the transposed array as an index for the for loop, which also did not work, only the last column was replaced as shown in output array 3.
Here is the snapshot and the Vi attached.
Thanks,
Gu
Solved! Go to Solution.
01-05-2020 03:34 PM
You are not using shift registers on the "A" array. So basically the first iteration you are replacing the second column, but then discarding those changes the next iteration.
01-05-2020 03:41 PM
Hi StevenD,
Thank you so much for your prompt reply.
Gu
01-05-2020 04:03 PM
This doesn't answer your question, which has already been answered, BUT, it greatly simplifies your code.
All you need is ONE replace array subset; the other code is Rube-Goldberg like.
mcduff
01-06-2020 01:28 AM
Hi mcduff,
Thanks a lot.
Gu