필터 지우기
필터 지우기

trouble using iterations and plotting

조회 수: 1 (최근 30일)
George  Zimbodia
George Zimbodia 2014년 9월 15일
댓글: Star Strider 2014년 9월 15일
Got it thanks!
  댓글 수: 3
George  Zimbodia
George Zimbodia 2014년 9월 15일
편집: George Zimbodia 2014년 9월 15일
Got it thanks!
Star Strider
Star Strider 2014년 9월 15일
Please don’t delete or erase the text of your original Question. Doing so eliminates the context others may need if they have the same problem and search MATLAB Answers for a solution.

댓글을 달려면 로그인하십시오.

채택된 답변

Star Strider
Star Strider 2014년 9월 15일
‘The question is a practice problem from a professor. The question asks me to use for and/or while loops’
Using a while loop:
t = 6.8;
k = 1; % Initialise Counter
while (t >= 6.8 && t <= 17.9)
f(k) = 3.98*t.*exp(52.65*(t-9.4));
t = t +.1;
tv(k) = t;
k = k+1;
end
figure(89)
plot (tv,f)
You have to keep track of ‘t’ and ‘f’ as vectors regardless of using a while or for loop. There are several ways of using a for loop for this problem, so I’ll let you experiment with them, since this is homework.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by