10-05-2010 05:30 PM
How a 2D array with a special structure can be reorganized?
The 2D array is obtained reading an appended spreadsheet generated as result of next actions:
The measurement system uses a main variable (V1 having N_V1 measurement points ) and a secondary variable (V2 having N_V2 measurements steps).
The measurements are performed varying V1 in a loop of NV2 steps of V2 variable. The measurements are easy saved writing data in an appended excel file.
These data must be reorganized as following i)after variable V1 values only ; the V2 values will be the labels of each set of measurements corresponding of v1values.
In figures 1 and 2 there are a 4meas.steps of V1 and 3meas.steps V2 results in initial and intended final excel file( the final form(fig2)doesn’t include the labels for V2)
Regards,
Mabel
10-05-2010 10:51 PM
Do you always know it is 4 steps repeated over and over in the first column? Could it ever be different? If it can change, will the user know what the number is or does your VI have to figure it out for itself.
I assuming the user knows it is X = 4 for the first column that is repeated. You can do and index array to get the 0th column and the 1st column. Do array subset to get the first 4 elements of the 0th column. Take the #1 column and do a reshape array to that you have 4 rows, and the length of the 1-D array divided by 4 (call this Y) for columns. Now you have a 4 row array you can build with the 4 row by Y column array.
10-14-2010 03:51 AM