LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

urgent help on array

Hi

 

I want to Sort an array elements with help of Row 0 in the order of another array.

 

Thanks

0 Kudos
Message 1 of 13
(4,148 Views)

Hi nitya,

  Please try to use the mathscript node with command as [c,d]=sort(a,b) where a is a matrix/2-d array and b=0/1 where 1-sorts matrix by row and 2-sorts matrix by column.Please check.

 

 

thanks and regards,

srikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 2 of 13
(4,140 Views)

hi

 

 

I have'nt used math script can u post me the code pls.

 

Thanks

0 Kudos
Message 3 of 13
(4,138 Views)

Is there any other way apart from using math script ??

0 Kudos
Message 4 of 13
(4,136 Views)

Hi Nitya,

  Can you please reattach your Vi ,i could not able to download it..

 

THanks and regards,

srikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 5 of 13
(4,132 Views)

Hi

 

please find the attachment

0 Kudos
Message 6 of 13
(4,123 Views)

Hi nitya,

  If you install openg toolkits,you will get one function by name sort array which can sort 2-d arrays also either ascending ro descending,row or column wise..I attached the same vi(version 2009)..Find it in the attachments.

 

 

Thanks and regard,s

srikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 7 of 13
(4,104 Views)

Hi SriKrishna

 

I'll check it out.

 

Thanks

 

 

0 Kudos
Message 8 of 13
(4,098 Views)

 


@Nithyamv wrote:

please find the attachment


 

Sorry, the text:

"The values alone in the Refix array should be replaced in the orginal array with referance to row 0 in original array.

The Row 0 is default only the corresponding values should be picked up from refix and should be placed it in the original."

 

Is incomprehensible to me. 😞

 

Could you add a third array to the front panel that shows what kind of result you actually want?

 

For example if the original array is:

 

B1  B2 B11  B9

 1   z   z   z

 0   z   z   z

 1   z   z   z

 

And the refix array is:

 

B9 B11  B2  B1

 2   2   2   2

 2   2   2   2

 2   2   0   2

 

What would the desired result look like?

 

The values alone in the Refix array should be replaced in the orginal array with referance to row 0 in original array.
The Row 0 is default only the corresponding values should be picked up from refix and should be placed it in the original.The values alone in the Refix array should be replaced in the orginal array with referance to row 0 in original array.The Row 0 is default only the corresponding values should be picked up from refix and should be placed it in the original."

 

0 Kudos
Message 9 of 13
(4,089 Views)

The result should be

B1  B2 B11  B9

 2   2   2   2

 2   2   2   2

 2   0   2   2 

0 Kudos
Message 10 of 13
(4,084 Views)