From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Storing 1D array in multiple columns using write to spreadsheet

Hi

 

I am getting 1D array and I am able to save in a single column using write to spreadsheet. However, I need to store this 1D array in multiple columns. For example if I am getting 1000 element in 1D array, I need to save 200 elements (user given number) in each column making total of 5 columns. 

 

Further, can I use this new 2D array to plot intensity graph? Please help. 

0 Kudos
Message 1 of 6
(2,866 Views)

Use Reshape Array and write it as a 2-D array to the "Write to Spreadsheet" subVI.

 

 

Sure, you can write it to an intensity graph.

0 Kudos
Message 2 of 6
(2,861 Views)

Thank you for your suggestion. I tried using reshape array and got 5 columns of 200 elements when I used an indicator but I could not write this to spreadsheet as well as to the intensity graph as it is giving error that I connected two arrays of different dimension. The output from the "Reshape array" has dimension 5 but the write spreadsheet and intensity graph can accept only 2. 

 

Please help.


@RavensFan wrote:

Use Reshape Array and write it as a 2-D array to the "Write to Spreadsheet" subVI.

 

 

Sure, you can write it to an intensity graph.


 

0 Kudos
Message 3 of 6
(2,854 Views)
You've done something wrong if you don't have a 2D array so show what you have done.
0 Kudos
Message 4 of 6
(2,847 Views)

Ok it look something like this. Here 30 elements in 1D array has to be arranged in 3 columns each with 10 elements. I tried to use "Reshape array" but its not working because of array mismatch. Isn't there any function other than "Reshape array"? It doesn't look too flexible to use "Reshape array" for large number of columns. 

 

Please help.

0 Kudos
Message 5 of 6
(2,835 Views)

@Paritosh wrote:

Ok it look something like this. Here 30 elements in 1D array has to be arranged in 3 columns each with 10 elements. I tried to use "Reshape array" but its not working because of array mismatch. Isn't there any function other than "Reshape array"? It doesn't look too flexible to use "Reshape array" for large number of columns. 


read the help. You are reshaping into a 3D array (size 10x10x10) instead of a 2D array. You should resize the "reshape array" function to only show two dimensions. If you want to 3x10 2D array, one dimension would be 10 and the other 3.

0 Kudos
Message 6 of 6
(2,828 Views)