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일

0 개 추천

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개)

카테고리

도움말 센터File Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

질문:

2019년 2월 4일

답변:

2019년 2월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by