index matching (sorting)
Amo
Hello,
I have two waves , "outWave" and "All_index_waves" ( has random index number ).
I want to make a new waves such that each element of outWave is based on the elements of "All_index_waves"
For example , zeroth point in "All_index_waves" is 3 and it corresponds to point 3 in "outWave" which is 312.33. Or fourth point in "All_index_waves" is 7 which corresponds to point 7 in "outWave" which is 63.6411. So i want to kind of re organize elements in "outWave" based on elements in "All_index_waves" for all points in my wave.
Thanks for your help.
Forum
Support
Gallery
Igor Pro 9
Learn More
Igor XOP Toolkit
Learn More
Igor NIDAQ Tools MX
Learn More
Hi,
Will this work?
Duplicate outWave, newWave
newWave[p] = All_index_wave[outWave[p]]
Andy
September 30, 2019 at 05:33 pm - Permalink
I think a simple Sort will work
Sort All_index_waves, outWave
October 1, 2019 at 08:19 am - Permalink
@Andy- remove "p" from the left side.
October 1, 2019 at 09:32 am - Permalink
In reply to @Andy- remove "p" from the… by johnweeks
Hi,
Would it be redundant to say you are correct?
Andy
October 1, 2019 at 09:40 am - Permalink
I appreciate your comments guys,
but the way it works is just:
duplicate waveOut, newWave
Indexsort all_index_waves, newWave
October 1, 2019 at 01:03 pm - Permalink