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 CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by