MATLAB Answers


How can i find column refer to row

Asked by Light
on 7 Jun 2013


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)



No products are associated with this question.

1 Answer

Answer by Walter Roberson
on 7 Jun 2013
 Accepted answer
negcolumn = find(A(ThisRow,:) == -1);
onerow = find(A(:,negcolumn) == 1);
A(onerow, negcolumn)    %crosscheck


Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!