MATLAB: Graph plot always appears as a straight line

Curve Fitting ToolboxgraphgraphicsMATLAB C/C++ Graphics Library

Hi, I don't know how to fix this. y graph looks like a straight line instead of an exponential curve. Please help me.. thanks a lot in advance !
l=0.5;
i=22/7;
v=0.8;
p=0.1;
x=[0:0.2:1.0];
y=(p*r^4*x)/(8*v*l);
plot(x,y)

Best Answer

You are varying x, instead of r. The code below shows how you could edit your code to plot y as a function of r.
l=0.5;
i=22/7;
v=0.8;
p=0.1;
x=0.1;
n_r_steps=100;
r=linspace(0,1,n_r_steps);
y=(p*r.^4*x)/(8*v*l);
plot(r,y)