showing all the elements of the answer matrix for specific result

조회 수: 1 (최근 30일)
mehra
mehra 2016년 11월 21일
댓글: mehra 2016년 11월 22일
In my codes I have a variable (K) which is a function of 4 other variables (K(a,b,c,d)=0) which vary in defined ranges. As a result the K will be a 4 dimensional matrix.For some values k become negative,My question is how can I write a command that shows the values of the variables which make k negative.

채택된 답변

Walter Roberson
Walter Roberson 2016년 11월 21일
[A, B, C, D] = ind2sub( size(K), find(K < 0) );
ABCD = [A, B, C, D];
disp(ABCD)
  댓글 수: 4
Walter Roberson
Walter Roberson 2016년 11월 21일
You have
ABCD = [Fr0, B, f0, B_h0];
but you did not get B from the ind2sub() output. You should have used
ABCD = [Fr0, dq_q0, f0, B_h0];

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by