Why did the matrix symbol become 10x10?

1 vue (au cours des 30 derniers jours)
fyza affandi
fyza affandi le 19 Nov 2018
Commenté : madhan ravi le 19 Nov 2018
>> format long
mat = [ 0.7188 0.0625 0.0625 0.0469 0.0313 0.0156 0.0156 0.0156 0.0156 0.0156 ];
index = find(ismember(mat,min(mat)));
b = index(end-1:end);
symbol= zeros(length(mat),(length(mat)-1),2);
for b1 = 1:length(b)
symbol((length(mat)-1),b(b1),2)=1;
end
The result is
symbol(:,:,2) =
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 1
0 0 0 0 0 0 0 0 0 0
I have declare 9 x 10 matrix but the above matrix shows 10x10

Réponse acceptée

madhan ravi
madhan ravi le 19 Nov 2018
Modifié(e) : madhan ravi le 19 Nov 2018
symbol= zeros(length(mat)-1,length(mat),2); %changed this line
  2 commentaires
fyza affandi
fyza affandi le 19 Nov 2018
Thank you sir
madhan ravi
madhan ravi le 19 Nov 2018
Anytime :)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Symbolic Math Toolbox 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