LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I apply a simple formula to each column of a matrix?

I thank you all who have provided me with answers to my previous questions. As you can see I am a beginner. My new question is: I am trying to scale and centre the data in my X matrix (by column) using X = Xi - 1(Xmean). How do I perform this for each column so that my new matrix is scaled and centred? I appreciate your help and thank you very much in advance.
0 Kudos
Message 1 of 3
(2,708 Views)
Simple array indexing using a for loop will work. Wire a 2d array into a for loop and the columns will be indexed automatically, then just do your math on that column and send it back out of the loop to get your 2d array back.
>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
0 Kudos
Message 2 of 3
(2,708 Views)
You can also use the Index Array function to index a column of data out of a 2D array by wiring to the Col Index instead of the Row Index.

Randy Hoskin
Applications Engineer
National Instruments
http://www.ni.com/ask
0 Kudos
Message 3 of 3
(2,708 Views)