Index exceeds matrix dimensions error
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
reza hamzeh
le 12 Jan 2020
Modifié(e) : Stijn Haenen
le 12 Jan 2020
hi. plz help me to fix this error.
t{1}=0;
for n=1:10
if n/2>2
t{n}=t{n}+1
end
end
% error: Index exceeds matrix dimensions.
0 commentaires
Réponse acceptée
Stijn Haenen
le 12 Jan 2020
Modifié(e) : Stijn Haenen
le 12 Jan 2020
You should use ( and ) not { and }.
Try this code:
t=zeros(10,1);
for n=1:10
if n/2>2
t(n)=t(n-1)+1
end
end
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matrix Indexing 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!