Can not plot, please help

2 ビュー (過去 30 日間)
Emre
Emre 2011 年 10 月 18 日
x = 0:1:10
y = (15*x)/(4*x.^2-3*x+4)
plot(x,y)
why can't i plot this? please help me.

採用された回答

Sean de Wolski
Sean de Wolski 2011 年 10 月 18 日
It is plotting, it's just only plotting a single point. The matrix division of a 1x11 vector by a 1x11 vector is a scalar.
ones(1,10)/ones(1,10)
You probably meant for element-by-element division
ones(1,10)./ones(1,10)
And thus your defintion of y:
y = (15*x)./(4*x.^2-3*x+4)
look at
doc vectorize
to avoid these issues in the future.
  1 件のコメント
Emre
Emre 2011 年 10 月 18 日
Thank you very much. it worked.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by