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];
mehra
mehra 2016 年 11 月 22 日
Thanks a lot.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by