NI Home > Community > NI Discussion Forums


Showing results for 
Search instead for 
Do you mean 
Posts: 1
Accepted Solution

Taking ln(x) of matrix elements

I have a 1x6 matrix of data points that I want to manipulate. The equation I need to operate on them is 10ln(x)+10, where x is the data input. The problem I'm having now is to get the 1x6 matrix of ln(x). I've tried using the Natural Logarithm VI but it didn't work. I also tried trying to calculate element by element but couldn't get it to work either.

Chosen by topic author Emanon
Knight of NI
Posts: 30,562

Re: Taking ln(x) of matrix elements

[ Edited ]

In LabVIEW, a matrix is a special datatype and will substitute a matrix specific function for the lograrithm which requires a square input matrix and provides a complex result. Your matrix is not square! Did you even look at the help details?


If you want to do simple elementwise operations, I would recommend you use a plain 1D array instead and things will fall into place. Try it!


See attached modification.

LabVIEW Champion . Do more with less code and in less time .