showing all the elements of the answer matrix for specific result

1 vue (au cours des 30 derniers jours)
mehra
mehra le 21 Nov 2016
Commenté : mehra le 22 Nov 2016
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.

Réponse acceptée

Walter Roberson
Walter Roberson le 21 Nov 2016
[A, B, C, D] = ind2sub( size(K), find(K < 0) );
ABCD = [A, B, C, D];
disp(ABCD)
  4 commentaires
Walter Roberson
Walter Roberson le 21 Nov 2016
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 le 22 Nov 2016
Thanks a lot.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by