Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Trouble using while loops

1 回表示 (過去 30 日間)
Leora
Leora 2014 年 9 月 16 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Give the following function
f(x)= x^3 -(5x)^2 +2^(x) - 10000x
Use a while loop to compute f(x) and then create a plot for 0<x<20.
This is what I have so far, I know I have to define x but I don't know what to set x= to since it did not specify.
f(x)=x^3 -(5*x)^2 +2^(x) -10000*x;
while 0<x<20
end
  1 件のコメント
Geoff Hayes
Geoff Hayes 2014 年 9 月 16 日
Leora - your question seems like homework, so I will just give a hint. You know that x is greater than zero and less than twenty. You will need to choose a step size for x and iterate with the while loop conditioning on x being less than 20. Within the loop you will compute f(x) and increment x with the step size.

回答 (0 件)

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by