Hello friends!
I have three 2d points (the xx values represents time instants between [0;1] and yy represents rotation values): initial = [0 , 0]; middle = [0.5 , 1.5409]; final = [1 , 3.0817];
I'm looking to do an interpolation of the remaining points for each 0.1 in the xx axis. The easiest way is to do a linear interpolation using linspace, but in this case i dont want to use evenly spaced values. What i want to do have is to have lower yy values on the first 4 intervals ([0 ; 0.4]) and higher yy values on the last 4 ([0.6 ; 1]), like the one i represented on the image below with orange color (blue represents the linear interpolation). Any ideas? Thanks for helping! :)

 採用された回答

Star Strider
Star Strider 2015 年 10 月 8 日

1 投票

I would fit it with a Logistic function, simply because it looks like one.

4 件のコメント

Amaral
Amaral 2015 年 10 月 9 日
Yea it looks, also look like a Hill equation. I just couldn't get a equation to represent that data. :)
Star Strider
Star Strider 2015 年 10 月 9 日
I used the logistic function to estimate oxyhaemoglobin dissociation curves at one time. I abstracted the data from your plot, and fitted it to the logistic function with this:
x = 0:0.1:1;
y = [0.01 0.015 0.02 0.04 0.1 1.5 3.0 3.05 3.06 3.07 3.09];
LF = @(b,x) b(1) ./ (1 + exp(-b(2) .* (x - b(3)) ) );
B0 = [3; 0.5; 0.5];
B = nlinfit(x, y, LF, B0);
xfit = linspace(min(x), max(x));
figure(1)
plot(x, y, 'bp')
hold on
plot(xfit, LF(B,xfit), '-r')
hold off
It’s a reasonably good fit. (The nlinfit function is part of the Statistics Toolbox.)
Amaral
Amaral 2015 年 10 月 9 日
Yes it is! Thanks a lot friend! :)
Star Strider
Star Strider 2015 年 10 月 9 日
My pleasure!

サインインしてコメントする。

その他の回答 (1 件)

Robert Dylans
Robert Dylans 2015 年 10 月 8 日
編集済み: Robert Dylans 2015 年 10 月 8 日

1 投票

If there's no particular requirement for the function's data, other than it "looks like" that kind of shape, you can use a formula similar to this:
x=0:0.01:1;
y=3.0817*(1-(1-((2*x).^3)./8).^5);
plot(x,y)
This was just a formula I happened to be using for something else, that has a similar curve fit. I'm sure there are many with similar functions. Note that this one only works for values of x in the range of [0 1]

1 件のコメント

Amaral
Amaral 2015 年 10 月 9 日
That seems to be doing what i want! Thanks a lot! :)

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

質問済み:

2015 年 10 月 8 日

コメント済み:

2015 年 10 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by