LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array Indices --- Array Values both sholud interchange: Help needed

I have an array ,
 
Alpha_to
 
index-- Value
 
0 --    1
1----   2
2 ----- 4
3 ----  3
4 ----- 6 
5 ----- 7
6 ----- 5 
 
I have too keep Index  in Value  & value in index,I mean I would like to change index & Value of Alpha_to array and store in new array like
 
 
 
0  --- A0
1  ----0
2 -----1
3 ---3
4 ----2
5 ----6
6 ----4
7 ----5
 
and in this new array I would like to keep A0 in index '0'
 
please kindly help ,this will be useful for my academic project
 
regards,
Kolli
 
 
 
 
 
0 Kudos
Message 1 of 5
(3,121 Views)

Kolli,

You essentially have a 2D array (of 7 rows and 2 colums).  What you could do is, reshape this into a 1D array.  Then split it into two 1D arrays so as to have two columns as indivdual arrays.  Now build the arrays in the order you want (second column becomes first).  Finaly, insert the additional elements you want at the beginning of this resulting array. 

I could post the code, but I gather this is an academic exercise for you and won't spoil the fun.  However, the words in italics above are hints -- look for Array functions relating to those on the pallette. 

Good luck!

-Khalid

0 Kudos
Message 2 of 5
(3,106 Views)
Try this vi.....
0 Kudos
Message 3 of 5
(3,092 Views)

Hi, Khalid,

              Here Alpha_to is not a 2D array,it's a 1D array.

                 The first column 0,1,2----7 are the index values of corresponding array values of 1,2,4,3,6,7,5....

    In Alpha_to,  in index 0,the value is 1 and in index 1 ,the value is 2,

                                                                                           But I have to prepare a new array Index_of , inthat in index 1,the value is 0 and in index 2,the value is 1..like this.

                                                 Ultimately in the new array Index_of    ,in index 0, I have to insert the value 'A0'..

 

Actually I am working on my Master thesis "Implementation of Reed Solomon Encoder using LabVIEW" ,in this first step is i have converted the folowing 'gf.c'  into corresponding LabVIEW code.

 

I am here attaching gf.c & my deveoped code,in my code I successful only to generate Alpha_to only.

Download All
0 Kudos
Message 4 of 5
(3,085 Views)

Hi Jim,

Hi, Khalid,

              Here Alpha_to is not a 2D array,it's a 1D array.

                 The first column 0,1,2----7 are the index values of corresponding array values of 1,2,4,3,6,7,5....

    In Alpha_to,  in index 0,the value is 1 and in index 1 ,the value is 2,

                                                                                           But I have to prepare a new array Index_of , inthat in index 1,the value is 0 and in index 2,the value is 1..like this.

                                                 Ultimately in the new array Index_of    ,in index 0, I have to insert the value 'A0'..

 

Actually I am working on my Master thesis "Implementation of Reed Solomon Encoder using LabVIEW" ,in this first step is i have converted the folowing 'gf.c'  into corresponding LabVIEW code.

 

I am here attaching gf.c & my deveoped code,in my code I successful only to generate Alpha_to only.

Attachment GF_Multiplier1.vi (33 kb)
Attachment gf.c (3 kb)

Download All
0 Kudos
Message 5 of 5
(3,082 Views)