05-18-2012 03:03 AM
Hi!!! how do I combine two 1D array into 2D array.They have the same amount of row and column. So I am trying to get 2 column of data side by side.
I also need help in merging multiple 2D array, I have multiple 2D array with 2 column. However, one of the column's data is exactly the same as other 2D array. So how do I merge all the data together?
05-18-2012 03:08 AM
You can build the 1D array so that you can get 2D array. For combining 2 2D array you have to build the array and enable Concatenate inputs.
05-18-2012 03:20 AM
I have get the 1D array but how to combine to get 2D array?
05-18-2012 03:31 AM
Just use the build array function.
05-18-2012 04:22 AM
I tried but the value is incorrect.
05-18-2012 04:38 AM
Please post the code that you have tried.
05-18-2012 04:47 AM
I think this could help you :
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
05-18-2012 10:22 AM
I have to give Kudos to TiTou for showing off video.
Nextal, can you give some sample data so we can see what you are trying to do?
05-20-2012 07:22 AM - edited 05-20-2012 07:28 AM
Hi all. I am unable to show you my code now. I don't have the code with me now as it is at my workspace. Okay what I am trying to do now is is that I have a number from 0 to 255. every 5 step it will get a data from my detector. What I am doing now is to store the value in array. I had successfully build my 1D array for my data and 1D array for the number. I am not clear in expressing here is a example.
Number 1D array Data 1D array
0 0.9236
5 1.2653
10 1.1940
15 1.2691
20 0.9987
25 1.4567
30 1.9746
35 1.3445
40 1.9953
. .
. .
. .
255 1.4372
How I get all this value into a 1D array is to use a while loop with shift register and store it.
What I am trying to achieve now is to get a 2D array with data side by side. I am using the build array vi:
Combine 2D array
0 0.9236
5 1.2653
10 1.1940
15 1.2691
20 0.9987
25 1.4567
30 1.9746
35 1.3445
40 1.9953
. .
. .
. .
255 1.4372
I used the build array and the number from 0 to 255 show correctly. However, for my data I only get the first data 0.9236 for every number.
Any ideal why this happen??
What I am getting now is:
Combine 2D array
0 0.9236
5 0.9236
10 0.9236
15 0.9236
20 0.9236
25 0.9236
30 0.9236
35 0.9236
40 0.9236
. .
. .
. .
255 0.9236
05-20-2012 07:36 AM
By the way this is how I create my 2D array.