Getting an error "INDEX OUT OF BOUNDS" in my matlab program. Please help.
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Virajan Verma
le 2 Oct 2018
Modifié(e) : madhan ravi
le 2 Oct 2018
for i=1:3 fepsn=i; end %%Loop for epsilon values for icounter=1:3 epsn=fepsn(icounter) Attempted to access fepsn(2); index out of bounds because numel(fepsn)=1.(ERROR HERE)
end
%%Shape function for axial effect N1(epsn)=(-1/2)*epsn*(1-epsn); N2(epsn)=(1+epsn)*(1-epsn); N3(epsn)=(1/2)*epsn*(1+epsn);
%%First Derivatives of Shape Function N1=diff(N1(epsn),epsn); N2=diff(N2(epsn),epsn); N3=diff(N3(epsn),epsn);
%%%%Second Derivatives of Shape Function N11=diff(N1(epsn),epsn,2); N22=diff(N2(epsn),epsn,2); N33=diff(N3(epsn),epsn,2);
0 commentaires
Réponse acceptée
madhan ravi
le 2 Oct 2018
Modifié(e) : madhan ravi
le 2 Oct 2018
for i=1:3
fepsn(i)=i; % (i) was added to avoid overwriting of the variable
end
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements 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!