From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-22-2019 03:21 AM
Hi,
I have an 1d array of 0,1,2,3,4,5,6,7,8 using reshape array I can make it:
0 1 2
3 4 5
6 7 8
But I want the even rows to be arranged in the reverse order i.e
0 1 2
5 4 3
6 7 8
Can anybody tell how can I do that.
kind regards,
Zoton
Solved! Go to Solution.
08-22-2019 03:31 AM - edited 08-22-2019 03:33 AM
Hi Zoton,
But I want the even rows to be arranged in the reverse order
Use a loop on the reshaped array and apply Reverse1DArray on each 2nd row…
(Be careful what you define as "even row" as LabVIEW starts to count array indices with zero!)
08-22-2019 11:35 AM
Hi Gerdw,
Thank you very much for your reply. I am new to this and I made the attached vi. Even though I am not sure if my approach is efficient or not but if I run the vi I cant build a new array with reversed odd index elements. After reading some related posts it seems like I need to use use the shift register as the previous rows gets replaced by zero. So my queries are:
1. How can I build the new array
2. How can i Initiate array for different data set size
Thanks again.
Kind regards,
Zoton
08-22-2019 01:00 PM
This is all you need.
08-22-2019 01:35 PM
I used replace array and shift register. Seems like its working. Is there any better way to do it?
08-22-2019 01:40 PM
Dear Paus,
This is awesome. More neat than the one of mine. Kudos.