lines to curves drawing problem
Show older comments
hello i have a problem with drawing curve on line or by other words
what i have: points on X-axis with their values on Y-axis as show in figure

what i need to do: draw curve between each two points (i don't want to show the figure as lines but as curves)
thank you
Accepted Answer
More Answers (1)
Mark
on 5 Jun 2013
The problem is that MATLAB doesn't know what curve you want, since there is no data between the points you have. You either need more data resolution, or you can tell MATLAB to make a smooth curve by interpolating with a spline:
xNew = 0:0.1:160;
yNew = interp1(x,y,xNew,'spline');
plot(xNew,yNew)
However, remember that the smooth curve is made up by MATLAB, so it could be misleading to show smooth curves if there are not really any in reality.
1 Comment
Anas A.Salam
on 5 Jun 2013
Categories
Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!