05-17-2009 07:51 PM
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!!
Solved! Go to Solution.
05-17-2009 10:37 PM - edited 05-17-2009 10:39 PM
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
05-19-2009 05:12 PM
Hi JK1,
Thanks for the help. Ya This is what I want for my application. It wrks perfectly:)