LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a matrix whose diagonal elements are determined by a control

Solved!
Go to solution

Hi,

 

How can I create a diagonal matrix whose diagonal elements are determined by a control?

 

Like  [ lamda 0; 0 lamda]

 

Thanks in advance.

Chuan

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

Hi!

 

Have you tried Set Matrix Diagonal function? It's in Mathematics -> Linear Algebra -> Matrix Palette

 

Marcin

              

Think Dataflow - blog.mtapp.tech
Message 2 of 5
(4,939 Views)

What have you tried, and why isn't it working?  Attach your code (meaning the VI itself) so we can see, try it, and advise you.

 

Some points to consider:

  • LabVIEW allows you to have N-dimension Arrays, including 2-D n-by-n Arrays.
  • LabVIEW also now allows a separate "Matrix" type.
  • There are structures such as the For Loop that work well when programmatically indexing through Arrays.
  • There are functions that "do certain things" for Arrays and Matrices.

Presumably you are using either Arrays or Matrices, and are using one or more LabVIEW Structures or Functions.  If you show us your code, we can make suggestions ...

 

Bob Schor

0 Kudos
Message 3 of 5
(4,931 Views)

Thanks for your advice. I use the 'create special Matrix.vi' to create a n-by-n identity matrix and I want this matrix to multiply a scalar, lamda. I don't know how to implement this.

 

Chuan

0 Kudos
Message 4 of 5
(4,927 Views)
Solution
Accepted by topic author Dirichlet123

You can just use Multiply function 🙂

 

Matrix scalar.png

              

Think Dataflow - blog.mtapp.tech
Message 5 of 5
(4,925 Views)