Table for for loop
Afficher commentaires plus anciens
I am trying to add a table but it is only giving me the last iteration of the for loop. I am not sure how to do so, please help. Thanks!
Here is my code:
clc,clear
for E=0.1:0.1:0.9
syms tn1 tn2
phi=atan(sqrt(1-E.^2)/E)+pi();
fn=@(tn1) [0.1+exp(-E*tn1)./sqrt(1-E.^2).*sin(tn1.*sqrt(1-E.^2)+phi)]; %f0.9
tn1=fzero(fn,2);
fo=@(tn2) [0.9+exp(-E*tn2)./sqrt(1-E.^2).*sin(tn2.*sqrt(1-E.^2)+phi)]; %f0.1
tn2=fzero(fo,2);
ftotal=tn1-tn2
end
table(E(:),ftotal(:))
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Common Operations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!