LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Insert text into a matrix with numberic values

Solved!
Go to solution

I have a matrix that I'm writting numberic decimal values to but I would like to know if there is a way I can also write text to the same matrix. Currently I have a 10 x 6 maxtrix that contains numberic values (data) but I would like to add a text column to the matrix. I'm using the matrix to display data.

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

Instead can't you use 2 D array to display 10 x 6 data?. If yes, you can convert the numeric array to string array and you can also add text along with it

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 6
(2,807 Views)

Attached is the VI I'm working on. The "Random Number" will be replaced with analog voltage measurements. I would like to add another column to the matrix but this will be a user entered text.

0 Kudos
Message 3 of 6
(2,787 Views)

I think I can use a 2D array... I will try this.

0 Kudos
Message 4 of 6
(2,786 Views)
Solution
Accepted by ashifulk

If you reaaly need a matrix datatype for the mathematics you will be doing, it might make more sense to have a separate string array for the row headers.  I used the Classic style Simple String for the array elements. Of course your wuold hide the string array label and Index Display.

 

Row headers.png

 

Also, simply create a 2-D array of numerics by autoindexing and then use the Array to Matrix primitive outside the loops.  This will be much more efficient than using Insert into Array and a local variable.

 

Lynn

Message 5 of 6
(2,767 Views)

Thank you, that will work.

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