キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Array Sort

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

0 件の賞賛
メッセージ1/4
3,082件の閲覧回数

Hi mamunk,

 

to appreciate your first post here you may start like this:

check.png

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!"

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 件の賞賛
メッセージ2/4
3,065件の閲覧回数

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 

Learning new things everyday...
0 件の賞賛
メッセージ3/4
3,062件の閲覧回数

Thanks to both of you.

0 件の賞賛
メッセージ4/4
2,993件の閲覧回数