From: omri374 Mendels on 2 May 2010 03:34 Hello, I'm trying to construct an interpolation using hermite polynomial (PCHIP). this is a piece of my code: %Xs is a two dimensional array of n rows and 2 columns: x and y. %step is a parameter that has keeps the number of points along the curve. x = Xs(:,1); y = Xs(:,2); t = Xs(1,1):step:Xs(n,1); p = pchip(x,y,t); arr = [t; p]'; I do get an interpolation, but the distances (euclidean) between points are not constant. I tried using another form of pchip: pp = pchip(x,y) that returns a structure with coefficients but still haven't figured out how to use this in order to build the curve I need. Any help will be appreciated! Thanks, Omri.
From: Bruno Luong on 2 May 2010 04:29 You might check out John's FEX submission: http://www.mathworks.com/matlabcentral/fileexchange/27096-interparc Bruno
From: omri374 on 2 May 2010 04:59 "Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hrjd4j$lal$1(a)fred.mathworks.com>... > You might check out John's FEX submission: > http://www.mathworks.com/matlabcentral/fileexchange/27096-interparc > > Bruno Thanks! it helps me a lot!
From: John D'Errico on 2 May 2010 05:59 "omri374 " <omrimendels(a)hotmail.com> wrote in message <hrjeso$dtj$1(a)fred.mathworks.com>... > "Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hrjd4j$lal$1(a)fred.mathworks.com>... > > You might check out John's FEX submission: > > http://www.mathworks.com/matlabcentral/fileexchange/27096-interparc > > > > Bruno > > Thanks! it helps me a lot! I must smile here, because I wrote that more for fun than expecting anyone to want to use it. It just seemed like a pretty application of an ode solver. An interesting question is if I can force the system I form to be a stiff one, thereby making ode45 a poor choice of solver. I believe this to be true, so while ode45 is indeed the best solver for this problem most of the time, I should offer an alternative choice of ode solvers. One more thing to add to the list. John
|
Pages: 1 Prev: Need Help in Creating a Gui Next: I can't get fplot to work... |