05-23-2013 04:28 AM
Hi,
I have a question to ask you.
I have a matrix N x M which contains a large number of zero. I wish to find the position of the element not equal to zero and to classify them in a table of two columns: line of the matrix and the column of the matrix. I do not need the value of the element.
Do you know how I have to proceed?
Thanks for help
05-23-2013 05:06 AM
hello marmotte,
here you go:
Alex
05-23-2013 05:15 AM
Matrix data type in LabVIEW is similar as an Array data type, you can use nested For loops to extract individual elements of the matrix and then just check if it is a non-zero element and if so store the iteration ('i' terminal) of both the loops... that will give you the row ('i' terminal of outer loop) and column ('i' terminal of inner loop) index of each non-zero element.
05-23-2013 05:21 AM - edited 05-23-2013 05:25 AM
If you are using LabVIEW 2012, it can be a bit more easier. I have used round to nearest integer as there are caveats in comparing floating point numbers.
Here: