t=0;
for w=35:5:45;
while (x<10) & (y<10);
x = exp(1.2)*cos(w*t);
y = t^3;
t=t+0.1;
end
t
end

 채택된 답변

James Tursa
James Tursa 2015년 9월 11일
편집: James Tursa 2015년 9월 11일

0 개 추천

Did you mean to use cosd instead of cos? From your w values it looks like maybe w is in degrees. Also, I don't see x or y initialized. E.g., maybe start with x = exp(1.2) and y = 0 prior to the loop start?

댓글 수: 1

Tuntoon
Tuntoon 2015년 9월 11일
I totally forgot that how MATLAB handles radians and degrees. Thank you for the reminder.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

질문:

2015년 9월 11일

댓글:

2015년 9월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by