Graph won't display

18 ビュー (過去 30 日間)
Jamie Baxter
Jamie Baxter 2019 年 2 月 4 日
回答済み: Kevin Phung 2019 年 2 月 4 日
I was trying to plot a simple graph of y = x^2 / (pi*(1-x)) but the graph is not displaying
The following code just displayed one point on the graph,
x = linspace(0,10,100)
y = x.^2 / (pi*(1-x))
plot(x,y)
Does anyone know why this is not working?

採用された回答

Kevin Phung
Kevin Phung 2019 年 2 月 4 日
you need to do element wise operations with a period before:
x = linspace(0,10,100)
y = x.^2 ./ (pi.*(1-x))
plot(x,y)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by