Why is S=t/10 acceptable and S=t/100 giving me an error term?
Show older comments
I am trying to vary the parameter S from 0.17 to 1.00 by increments of 0.01 and solve for r. I can get it to go from 1.7 to 10 in increments of 0.1, when S=t/10, but I cannot get S=t/100 to work. MATLAB tells me that the error is in that line, but does not describe the cause of the error. Any ideas why this is not letting me do it?
function a=poop(r)
for t=17:1:100;
%why does S=t/10 work and S=t/100 not work?
S=t/100;
radius(t)=fsolve(@(r)(acos((4-(2^0.5)*(2+21*r^2)^0.5)/(3*(2^0.5)*r))...
+2*acos((2^0.5)*(2+21*r^2)^0.5 -1)...
+((4-(2^0.5)*(2+21*r^2)^0.5)/(3*(2^0.5)*(S-2*r^2)))...
*(-(4/3)*r^2+4/9*(2^0.5)*(2+21*r^2)^0.5-(10/9))^0.5...
+((2^0.5)*(2+21*r^2)^0.5-1)/(3*(S-2*r^2))...
*(-r^2/6+(2+21*r^2)^0.5/(9*(2^0.5))-5/36)^0.5 - pi),0.3)
a(t,:)=[S radius(t)]
end
end
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing 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!