LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to convert 1D array fo double to 1D array of variant?

I want to use the KNN vi in machine learning toolkit  but the example input require a data type of 1D array of variant. How can I make the convertion? Thanks.

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

Hi winnie,

 

maybe just like this:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,781 Views)
Thanks for your answer, I try your method and it works for convert a 1D array of double control to 1d array of variant indicator.But I want to use the variant array as input of the KNN vi,when I change the above indicator to array and connect it to vi and run the program,nothing happen. I don't know why...
0 Kudos
Message 3 of 6
(2,749 Views)
I mean chance the variant array indicator to control to connect it to the input of the vi.
0 Kudos
Message 4 of 6
(2,748 Views)

Just wire the Array of double to the input connector that is an array of variant.  LabVIEW will take care of the conversion for you.  That is what Gerd was trying to show you.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 6
(2,741 Views)
Oh I see it. Thank you.
0 Kudos
Message 6 of 6
(2,736 Views)