Spline coordinates from spap2
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Biraj Khanal
el 29 de Jun. de 2022
I am trying to get third order spline approximation for a given set of points.
p=[..;..];
spline=spap2(knots,3,p(1,:),p(2,:));
This works and I can use fnplt to plot the curve. Howver, I am not sure how I can get the orthogonal coordinates.
For cscvn, fnval would return a 2D matrix of coordinates. However, it does not work here. Is there any solution to this?
4 comentarios
Respuesta aceptada
Torsten
el 29 de Jun. de 2022
Editada: Torsten
el 29 de Jun. de 2022
x = -2:.2:2;
y=-1:.25:1;
[xx, yy] = ndgrid(x,y);
z = exp(-(xx.^2+yy.^2));
sp = spap2({augknt([-2:2],3),2},[3 4],{x,y},z);
xyq = [1.8;0];
value = fnval(sp,xyq)
exp(-xyq.'*xyq)
2 comentarios
Torsten
el 1 de Jul. de 2022
Editada: Torsten
el 1 de Jul. de 2022
p1.coefs
give you the coefficients of the B-spline. My guess is that these are the coefficients a_ij in the representation of the spline
s(x,y) = sum_i sum_j a_ij * B_i(x) * B_j(y)
But you should read the documentation if this is correct.
Más respuestas (0)
Ver también
Categorías
Más información sobre Spline Postprocessing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!