フィルターのクリア

How to plot the function f(x)=x^3 - 4x^2 +1 for x∈[0,25]

18 ビュー (過去 30 日間)
Potatopao
Potatopao 2015 年 4 月 14 日
編集済み: pfb 2015 年 4 月 14 日
x= 0:0.01:25. For y=x^3 - 4x^2 +1 your plot command will be variant of plot(x,y).

採用された回答

pfb
pfb 2015 年 4 月 14 日
You almost got it. Since x is a vector, you should use elementwise operators. not x^2 (what's the square of a vector?) but x.^2.
  1 件のコメント
pfb
pfb 2015 年 4 月 14 日
編集済み: pfb 2015 年 4 月 14 日
also, you should write the multiplication operator (*) explicitly
x= 0:0.01:25
y=x.^3 - 4*x.^2 +1;
plot(x,y);

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by