MATLAB: Plot smoothing to get a curve

plotsmooth

Hy how to use smooth option to get a curve plot
XA = 0:1:5
YA = 2.^XA
plot(XA,YA)

Best Answer

Use the linspace function to create ‘XA’:
XA = linspace(0,5);
This creates 100 (by default) regularly-spaced elements for ‘XA’ between 0 and 5.