x=[-28.87 -27.35 -18.67 -22.42 -34.53 -52.73 -60.72 -68.06 -87.41 -94.16]';
y=[-11.56 -5.57 3.26 7.15 7.69 5.82 7.99 10.45 2.70 0];
plot(x,y,'ro-');
grid;
axis equal;
I have tried the polyfit but not successful, which changed my data order firstly.
I want to make a curve fit which can keep the shape of the path in above figure. Especially in the right side where there is a ear or shoulder shape.
Thanks,
x=[-28.87 -27.35 -18.67 -22.42 -34.53 -52.73 -60.72 -68.06 -87.41 -94.16]';
y=[-11.56 -5.57 3.26 7.15 7.69 5.82 7.99 10.45 2.70 0];
plot(x,y,'ro-');
grid;
axis equal;
I want to make a curve fit which can keep the shape of the path of the figure above, especially in the right side where there is a ear or shoulder shape.
Thanks
You might download and try EzyFit from the MATLAB FEX at:
http://www.mathworks.com/matlabcentral/fileexchange/10176
You will still have to make some guess as to the type of equation you want to fit to.
What type of equation will give you the "ear or shoulder shape" you want?
Think about it!
I would suggest a simple model:
yhat = mean(y)
John
What is the idea of your simple model. I can not follow it. Thanks,
x=[-28.87 -27.35 -18.67 -22.42 -34.53 -52.73 -60.72 -68.06 -87.41 -94.16]';
y=[-11.56 -5.57 3.26 7.15 7.69 5.82 7.99 10.45 2.70 0]';
plot(x,y,'ro-');
grid;
axis equal;
figure;
p=[x' ; y'];
fnplt(cscvn(p));
grid;
A polynomial fit for this data is simply fatuous.
I'm sorry, but it would be ridiculous in the
extreme. Just to throw random data into a
computer and expecting anything sensible to
come out, with no further input from the
scientist, analyst, or other knowledgeable
person?
You have no model for the curve, nor have you
expressed any indication that there should be a
model, mechanistic or not, for this data. It is
apparently not much more than a random walk.
The best predictor for such a random process is
probably just the mean of the data. Certainly so
if you have no other information to provide.
john
Is 'y' a function of 'x'? The order of the points seems to suggest
otherwise.
-Will Dwinnell
http://matlabdatamining.blogspot.com/