Table for for loop
Show older comments
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(:))
Accepted Answer
More Answers (0)
Categories
Find more on Common Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!