printing succsessive values

1 回表示 (過去 30 日間)
Si
Si 2011 年 5 月 9 日
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

採用された回答

Walter Roberson
Walter Roberson 2011 年 5 月 9 日
Remove the semicolons from the end of the two assignments to phi
  1 件のコメント
Si
Si 2011 年 5 月 14 日
fantastic thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by