LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error permuting matrix rows

Hi

 

Ive tried to create a VI which randomly permutes rows of a matrix (the matrix is the input/the subvi), but

labview shows me an error, saying that Ive connected terminals of two different types - athough both are long.

Can someone tell me, whats wrong with my vi?

I would be greatful.

Thanks,

Mychelle

0 Kudos
Message 1 of 10
(3,102 Views)

The terminals are not both long, you're trying to connect an array of long to a long.

 

Ben

0 Kudos
Message 2 of 10
(3,088 Views)
so what exactly (and how) shall I change it?
0 Kudos
Message 3 of 10
(3,074 Views)

Here is a way to swap two rows in an array.

 

Ben

 

Swap Array Rows.png

0 Kudos
Message 4 of 10
(3,062 Views)

thanks a lot, could you maybe be so kind and upload the VI?I just dont find the same icons for the

array methods you used (maybe due to different labview versions?).

thx

0 Kudos
Message 5 of 10
(3,044 Views)
..sorry, I was first using firefox and so didnt see, that you can use the snippet..
0 Kudos
Message 6 of 10
(3,037 Views)

Mychelle wrote:

thanks a lot, could you maybe be so kind and upload the VI?


 

 
 The image above is a snippet and contains embedded LabVIEW code. Simply download the image and then drag it into the diagram. It will turn into runnable code.
 
(EDIT: Ah, I see you noticed. Anyway, "index array" is resizeable, so there is no need for two instances as in Ben's example.) 
Message Edited by altenbach on 02-20-2010 02:13 PM
0 Kudos
Message 7 of 10
(3,035 Views)

If you have a newer version of LV,  wouldn't it be cleaner to use some of the newer memory structures like in place element and swap values?

 

 

Message Edited by Ravens Fan on 02-20-2010 05:27 PM
0 Kudos
Message 8 of 10
(3,024 Views)

Ravens Fan wrote:

If you have a newer version of LV,  wouldn't it be cleaner to use some of the newer memory structures like in place element and swap values?


 

 
 The OP want to swap entire rows in a 2D array. The in place element structure currently only supports single elements.
0 Kudos
Message 9 of 10
(3,015 Views)

altenbach wrote:

Ravens Fan wrote:

If you have a newer version of LV,  wouldn't it be cleaner to use some of the newer memory structures like in place element and swap values?


 

 The OP want to swap entire rows in a 2D array. The in place element structure currently only supports single elements.

 

You're right.  I failed to notice that the wire coming out of it was thin as in scalar.
0 Kudos
Message 10 of 10
(3,007 Views)