How does Matlab know the boudary condition of spline while I did not provide?

3 visualizaciones (últimos 30 días)
When I use the spline functions in Matlab, I find most of them don't neeed boundary condition. So, I wondered there must be some way to determine it in Matlab. And I really want to know "How?"
  1 comentario
Andreas Goser
Andreas Goser el 26 de Sept. de 2011
I have just a process, not a real answer, thus putting this as comment. Files like spaps.m and spline.m are written in MATLAB language and thus can be opened in an editor. Maybe you can fnd would you look for in the code.

Iniciar sesión para comentar.

Respuestas (1)

John D'Errico
John D'Errico el 15 de Nov. de 2020
Depending on the specific spline tool used, you can often set the boundary conditions. Spline, for example, allows you to set the end point slopes. However, by default, spline uses what are called the not-a-knot end conditions. That is, spline creates an everywhere twice differentiable function. But at the breaks, the third derivative can have a discontinuity. So spline uses a choice of end conditions where third derivative continuity is enforced at the seconf and penultimate break. Effectivey, that makes those break points not truly breaks.
Other splines allow different sets of boundary conditions if you choose to use them. Thus you can create natural cubic splines if you wish.
Finally, some tools like pchip, are not truly splines. They don't really need to use boundary conditions as you describe.

Categorías

Más información sobre Splines en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by