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

shifting the rows of a 2D array

解決済み
解決策を見る

Hello evryone!!

I have a 2D array called message which looks as in the VI attached.

example: 11011001

                10011011

 I have another 1D array called shifts which generate random numbers from 0-5 for the number of rows in message..

example: 2 5

 

I now have to creat a 2D array, each row having the size of message+maximum (shifts array)

And into each row of this 2D array, I have to input a row of the message array starting at the corresponding value given by the shifts array as index. if the shift value is not  maximum i.e 5 in this case, the rest of the values have to remain zeros.

 

Example: 0 0 1 1 0 1 1 0 0 1 0 0 0

                0 0 0 0 0 1 0 0 1 1 0 1 1

 

Any suggestions as to how to do this? Thanks!!

 

0 件の賞賛
メッセージ1/3
3,379件の閲覧回数
解決策
受理者 LSASS

Creating such a 2D array has a problem.   conside a shifts 1D array like this 2 5 1.  So your 2D aray will be like this:

msg array:

11011001

10011011

10101011

 

0 0 1 1 0 1 1 0 0 1 0 0 0

0 0 0 0 0 1 0 0 1 1 0 1 1

0 1 0 1 0 1 0 1 1 0 0 0 0

 

The last 4 zeroes are not part of the msg but will show as if its part of the message.  Is this condition taken care in your code?  (Stil this can be handled by using the shift value and length of the message block.  Is your message block constant? )

The vi attached does the task you hav describedスマイリー ハッピー

 

Message Edited by JK1 on 05-17-2009 10:39 PM
With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
メッセージ2/3
3,368件の閲覧回数

Hi JK1,

 

Thanks for the help. Ya This is what I want for my application. It wrks perfectly:)

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