Hello everyone,
I have a matrix and I would like to find all of the rows such that the entry in the first column does not match the entry of the second column.
Background: I am running some finite element code. I am finding all entries of the stiffness matrix that are positive, but in particular I want to find the stiffness matrix off-diagonal entries that are positive.
Thank you in advanced!
Andrew

 채택된 답변

madhan ravi
madhan ravi 2020년 6월 4일

0 개 추천

matrix(:,1) ~= matrix(:,2)

댓글 수: 1

Andrew Miller
Andrew Miller 2020년 6월 4일
Thank you. If I set this to a l=matrix(:,1) ~= matrix(:,2), then I can find(l==1) will give back the entries desired.
Thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

제품

릴리스

R2018b

질문:

2020년 6월 4일

댓글:

2020년 6월 4일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by