03-30-2020 12:24 PM
I want to turn a string consisting of two columns of numbers to a 2D array so that I can graph the data on an XY graph. How would I do this?
For example, if the string is
1 5
2 4
3 7
4 9
How would I convert this string to a numeric 2D array?
03-30-2020 12:51 PM
Try "Spreadsheet string to array" and set your delimiter to "Space".
03-30-2020 12:55 PM
By doing this, my array only returns the first column. I need both values in the first row. There's likely something small I'm missing.
03-30-2020 12:59 PM
03-30-2020 12:59 PM
@zackmurphy wrote:
There's likely something small I'm missing.
Of course there is, but if you don't show us your code and actual string, we cannot help.
03-30-2020 01:01 PM - edited 03-30-2020 01:02 PM
No pictures, the actual VI please! We cannot debug pictures!
Also please resize your array containers to show more than one element.
(You delimited looks more like an empty string instead of a space character. LabVIEW will assume tab in that case.)
03-30-2020 01:05 PM
@zackmurphy wrote:
By doing this, my array only returns the first column. I need both values in the first row. There's likely something small I'm missing.
Is your delimiter (the character between values) actually a space? Or is it a tab? Are you sure you even have a space in your delimiter constant? There is a Space Constant to make it more clear.
03-30-2020 01:08 PM
My apologies. Here are photos of my front panel and block diagram.
03-30-2020 01:11 PM
Make sure you're expanding the array indicator both vertically AND horizontally.
And post your code, not just pictures (Select All, Edit: Create Snipped from Selection).
03-30-2020 01:16 PM
Here's the snippet.