Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

create matrix?

Is there an easy way to create a square matrix from a few inputs? I would like to put in a maximum number and the number of elements across and down and have a matrix be created. So for example, I say I want the the max magnitude to be ten and I want 21 intervals, could I get a matrix whos first line would be -10 -9 -8 -7....0 1 2 ...10? THanks for any help.
0 Kudos
Message 1 of 5
(3,506 Views)
Hi AnthonyM,

I am not clear by your description of the inputs how exactly the matrix should look for any given set of inputs. A Square Matrix is one that has the same size horizontal and vertical dimensions. I am not sure how a "maximum number" and the "number of elements across and down" as inputs relate to creating a specific square matrix.

To generate the first line as you described, you could certainly use a for loop, and some mathematical operations to build that set of numbers into an array. If you can post a more detailed description of what should be produced for a given set of inputs, and what language you are using to develop this application we should be able to give you a more complete answer.

Scott Y
NI
0 Kudos
Message 2 of 5
(3,492 Views)
So I would like to use it to perform imaging. The matrix element would be the "location" of each pixel and would correspond to a voltage that tells a mirror where to aim the light. This matrix would have to have a maximum number in any one pixel of 10V because that is the limitation of the mirror. It would also be nice if the matrix could be built up by pairs of numbers so as to correspond to a X and Y position. By square I mean that for ease I was going to make all of the images square and assumed this would be an easier matrix to make. Please let me know if this helps.
0 Kudos
Message 3 of 5
(3,486 Views)
Hello AnthonyM,

Can you please post with the following information.

1) The programming language are you using to develop this applcation.

2) A few examples including the specific inputs used to create a specific 2D square matrix.

3) A description of the patterns used to generate the matrix.


Thank you,

Scott Y
NI
0 Kudos
Message 4 of 5
(3,469 Views)
Thanks for the help but I got it. I'll repost if I have any problems with it though

A
0 Kudos
Message 5 of 5
(3,465 Views)