Just wanted to know if matlab had a function to plot curves instead of lines. Thank you in advance.
A:
Curve Fitting with Matlab http://www.swarthmore.edu/NatSci/echeeve1/Ref/MatlabCurveFit/MatlabCftool.html
Robert Harvey
2009-12-15 01:20:18
OP asked for plotting curves, not fitting curves.
Jason S
2009-12-15 01:25:53
Well if you're gonna plot it, you gotta fit it first either way. It all comes down to linear segments at the bottom ... the detail is only whether you're determining what's in between or some intrinsic function.
ldigas
2009-12-15 02:06:35
A:
If you are looking for something like splines then yes, just use the spline
function
hhafez
2009-12-15 01:20:51
there's a "spline" function (http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spline.html) but it is curve-interpolating, not plotting. (is there a "splines" function?)
Jason S
2009-12-15 01:27:43
defintly, but the question I believe was not worded correctly, yet everyone understood what he meant ;) The questioner said he wants to plot a curve while in reality he already had a set of points that he wanted to plot smothely (for example using splines)
hhafez
2009-12-17 22:32:15
+3
A:
No. Not at all. Just plot a set of many points, using connect-the-dots. Use enough points to get the accuracy you want. Any curve that you can plot will be well represented by such a piecewise linear plot anyway, if you use a fine enough set of points.
If all that you have are a set of points, then use a spline to interpolate them smoothly to get a nice smooth looking curve. Spline, interp1, pchip, or the splines toolbox will help you in this task.
woodchips
2009-12-15 01:59:52
+4
A:
An example of using spline
to interpolate then plot the result:
x = 0:2:6*pi;
y = sin(x);
plot(x,y, 'b-'), hold on
xx = 0:0.1:6*pi;
yy = spline(x,y,xx);
plot(xx, yy, 'r-', 'linewidth',2)
Amro
2009-12-15 02:01:00