Variable change over time

조회 수: 15 (최근 30일)
Amaral
Amaral 2015년 10월 8일
댓글: Star Strider 2015년 10월 9일
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일
I would fit it with a Logistic function, simply because it looks like one.
  댓글 수: 4
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일
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! :)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by