How to get relatively smooth plot than step plot

16 views (last 30 days)
hi, I have 2 arrays having around 400 values of x and y. I plotted the graph but it came out to be rather stepped than smooth. I was wondering if we can plot a smother curve..? Attaching plot image and curve...
a[400] % not mentioning values ;
b[400];
f = figure();
plot(a,b)
filename = [sprintf('%01d',1) '.jpg'];
saveas(f, filename,'jpg');
n = numel(x);
xi = interp1( 1:n, a, linspace(1, n, 10*n) );
yi = interp1( a, b, xi );
hold all;
plot( xi, yi );

Answers (0)

Community Treasure Hunt

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

Start Hunting!