03-17-2010 08:57 AM
Hello 2 all !
I have the following problem :
I have a matrix, in wich "i" is the index of the rows and "j" is the index of the columns.
I want to see if the elements of the matrix that are situated below the main diagonal are equal to zero.
How can i achieve this ? Any ideas ?
Thank you very much 4 your time !
Solved! Go to Solution.
03-17-2010 09:10 AM
Sounds like a job for Get Matrix Diagonal
03-17-2010 09:11 AM
03-17-2010 09:52 AM
Thank you 4 your quick answer !
Because i'm using labview 8.5, i don't have the "Get Matrix Diagonal" function, so i would very much appreciate an vi containing this function as an example.
A example problem would be :
Given a matrix of the form :
1 2 3
4 5 6
7 8 9
i would like to find out if the elements situated at the indexes (i,j) : 1,0 ; 2,0 and 2,1 are equal to zero.
Thank you very much.
03-17-2010 10:11 AM
I actually assumed you wanted the first sub-diagonal instead of the lower triangular matrix. Now you are stuck with indexing.
Here is 8.2 version as well. After the For Loop the Upper Triangular part plus the diagonal will be zero automatically, if all of the elements are zero then you know the lower triangular part was zero.
03-17-2010 11:03 AM
Ok ! Thank you very much !
That was exactly what i was looking for.
09-01-2019 11:57 PM
I am struggling with extracting the upper triangle of the matrix, do you have any suggestions on how to perform this? The upper seems more difficult because the index does not start from zero. I have tried using an array subset and also indexing the array and have had no luck.
09-02-2019 12:04 AM
Post your best attempt at getting it. Indexing and array subset is all you should need.
But when you say you wan the upper triangle, what exactly do you want the output to look like? Because there is no triangle array in LabVIEW. Do you want it to be the array but the elements that aren't in the upper triangle to be zeroed out?
09-02-2019 02:06 AM - edited 09-02-2019 02:10 AM
Thank you for your reply RavensFan,
My first attempt I tried to get the output in a 3x3 matrix with zeros in the elements that are not part of the upper triangle, such as in Darin.K's example. I figured this was not possible so i am currently just trying to get the output in a 1 dimensional array. Either way is acceptable.
I'm pretty sure my logic here is way off base, i'm just stuck and not sure how to get any further.
I am currently taking a data acquisition class and I have minimal (1 semester) experience with labview.
Thanks in advance!
Mike
09-02-2019 02:32 AM