How to get relatively smooth plot than step plot

15 visualizaciones (últimos 30 días)
Sushil Chaskar
Sushil Chaskar el 20 de Mayo de 2016
Editada: Sushil Chaskar el 20 de Mayo de 2016
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 );

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by