Why cant' I plot this graph?

2 views (last 30 days)
Anu Kunnath
Anu Kunnath on 23 Nov 2020
Answered: David Hill on 23 Nov 2020
x = linspace(0,2,250);
y = 15*x^3-9*x^2-36*x+36;
plot(y,x)

Answers (1)

David Hill
David Hill on 23 Nov 2020
You need .^ for elementwise array operations
x = linspace(0,2,250);
y = 15*x.^3-9*x.^2-36*x+36;
plot(y,x)

Categories

Find more on Polynomials in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!