01-24-2014 01:44 AM
Dear Friends;
I am stuck with the following problem.
I have an array as follows:
Array: {(1st row is Index, i.e. 1-6 or A-F); 2nd row is the corrospending value}
1 2 4 3 1 6 2 6
26 6 46 6 6 9 6 9
---------------------------------------------------------
I want to sort the avobe array as follows:
Desired Table: [6x7], {(1st col is Index, i.e. 1-6 or A-F); 2nd to 8th col are the corrospending value, missing one filled by 0}
1 6 26 0 0 0 0 0
2 6 6 0 0 0 0 0
3 6 0 0 0 0 0 0
4 46 0 0 0 0 0 0
5 0 0 0 0 0 0 0
6 9 9 0 0 0 0 0
Any help would be appreciable.
Regards-K
01-24-2014 02:21 AM - edited 01-24-2014 02:23 AM
Hi mamunk,
to appreciate your first post here you may start like this:
It's probably not the "best" solution, but it should work according to your description…
For the next time you should note we will not do your homework.
Attach your VIs and ask for specific problems - not just generic "I need something, can you create this for me!"
01-24-2014 02:23 AM
Hi mamunk2,
Do you have a vi related to this problem which you have worked on?
There is an example of the 2D sorter:
https://decibel.ni.com/content/docs/DOC-12264
https://decibel.ni.com/content/docs/DOC-17440
https://decibel.ni.com/content/docs/DOC-13719
http://www.ni.com/example/27502/en/
As for the missing one, you can create the 8x8 array using "Initialize Array" with the size value = 8 and the initial value = 0 which you fix. The final result of sorted array will replace the 8x8 array which you created using "Replace Array Subset".
Hope that helps,
Warmest regards,
Lennard.C
01-28-2014 08:17 PM
Thanks to both of you.