LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to convert a table to a number array

I have a very (probably) simple question. My front panel has a table in which the user fills in x values in the first column and y values in the 2nd column. I can't figure out how to convert the table (2d string array) to a cluster of 2 1D arrays of doubles, which I can feed into a xy graph.
0 Kudos
Message 1 of 5
(5,520 Views)
> I have a very (probably) simple question. My front panel has a table
> in which the user fills in x values in the first column and y values
> in the 2nd column. I can't figure out how to convert the table (2d
> string array) to a cluster of 2 1D arrays of doubles, which I can feed
> into a xy graph.
>

The string palette contains a block called Spreadsheet String to Array.
This block will take a 2D array of strings and produce a 2D array of
numerics using whatever formatting you need. To take the columns out of
the 2D array, you can use the index node. Assuming that you are using
LV6, wire up the 2D array and the node will grow to have two inputs for
selecting. I believe that you need to wire a constant to the top one
with the column that you want
out, then bundle the two arrays together
with a cluster node, X first then the Y, and it is ready for the graph.


Greg McKaskle
0 Kudos
Message 2 of 5
(5,520 Views)
There are problably many ways to do this.
Please find one in the file attachment.
It is in ver 6.0.
Message 3 of 5
(5,520 Views)

hi,

 

 this program help me to know how to convert the table to array..

Regards,
N. Srinivasan
0 Kudos
Message 4 of 5
(5,117 Views)

srinivasan.accent@gmail.com wrote:

hi,

 

 this program help me to know how to convert the table to array..


 

This program very nearly answered your question.  No?  It converts the table to an array of doubles and bundled them into a cluster wired to your XY graph.  The only thing it missed was that he didn't put the data in columns as you asked.  What more do you need?
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 5 of 5
(5,103 Views)