필터 지우기
필터 지우기

How can i find column refer to row

조회 수: 4 (최근 30일)
Light
Light 2013년 6월 7일
A=[-1,1,1;0,-1,0;0,0,-1;1,0,0];
blnA = logical( A == -1 );
blnOut = find(all(ismember(A,[0,-1]),2));
(Now i chose row 3) 0,0,-1
and how can i find a column which is including 1 and refering to that row 3's -1
( in that matrix column 3 must be chosen)

채택된 답변

Walter Roberson
Walter Roberson 2013년 6월 7일
negcolumn = find(A(ThisRow,:) == -1);
onerow = find(A(:,negcolumn) == 1);
A(onerow, negcolumn) %crosscheck

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by