printing succsessive values
2 次查看(过去 30 天)
显示 更早的评论
Hi I am fairly new to matlab and i have been given some questions. I have done questions 1,2 and 3 but cannot work out question 4. Any help would be much appreciated, sorry if iv been a bit vague.
1. Rearrange the equation to make the subject f:
2. Create a function segment(A,r) to find the arc subtended for a given area, and radius.
3. Make sure your working directory is in the Matlab path, and then solve for phi for Area of 0.1 m2, and a radius of 0.3 m.
4. Make your program print out the successive values of phi.
function phi = fragment(A,r)
% fragment the angle subtended by a circular segment
% fragment(A,r) is the fragment having an area A, and radius r.
% area of segment A = r^2 * (phi – sin(phi))/2
phi1 = 2*A/r^2;
phi2=phi1;
phi = sin(phi2) + phi1;
while abs(phi - phi2) > 0.0001
phi2=phi;
phi = sin(phi2) + phi1;
end
Many thanks Si
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!