Why can I not evaluate this while loop?
1 view (last 30 days)
Show older comments
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
0 Comments
Accepted Answer
James Tursa
on 11 Sep 2015
Edited: James Tursa
on 11 Sep 2015
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?
More Answers (0)
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!