How to get relatively smooth plot than step plot
13 次查看(过去 30 天)
显示 更早的评论
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 );
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!