LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a matrix with variables

Solved!
Go to solution

I have 12 double variables (not an array) and I wanted to put them all in a 4 by 3 matrix. I was trying to use the Build Matrix function but I could not figure out how I would define which variable would be in each position of the matrix.

0 Kudos
Message 1 of 5
(4,319 Views)

Hi humberto,

 

there are functions like BuildMatrix and SetMatrixElement - you should be able to build your matrix using them.

 

Then there are also BuildArray and ReplaceArraySubset. Using them you can create a 2D array, which you could convert to a matrix later on.

 

Why do you need a "matrix"? Would a 2D array be sufficient too?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(4,317 Views)

Hello GerdW,

 

I started thinking about using a matrix because I could not find how to create a 2D array using the Build Array function. I found out a couple minutes ago that I could use the Initialize Array function to create a 2D array. Is there any way I can do the same using just the BuildArray function?

 

Thank you for helping!

0 Kudos
Message 3 of 5
(4,314 Views)
Solution
Accepted by topic author humbertomoraes

Hi humberto,

 

I thought this would be explained in the beginner tutorials for LabVIEW, offered for free on NI's website:

check.png

Pretty easy, eh!?

 

Please go through those tutorials. Study the example VIs coming with LabVIEW.

It will help you to learn LabVIEW!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(4,308 Views)

Yeah, looks so. Sorry for that, I'm starting in Labview and I haven't seen that tutorial (just the self-paced video training) because I'm using Labview in a college and never bought it myself to access other courses. But I'll check that better.

 

Thank you very much GerdW.

0 Kudos
Message 5 of 5
(4,303 Views)