I have encountered a problem and would like to ask everyone to help solve it. The problem to be solved is how to close the following two fitted curves. Thank you very much for your enthusiastic answers.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
My code:
load dataA.mat
%x1=dataA(:,1);
%y1=dataA(:,2);
f1 = fit(xAbove,yAbove,'smoothingspline','SmoothingParam',0.0001);%smoothingspline
%plot(f1,xAbove,yAbove)
plot(f1,'-r')
hold on
load dataB.mat
%x2=dataB(:,1);
%y2=dataB(:,2);
[xx,ind] = sort(xBelow);
yy2 = smooth(xBelow,yBelow,0.5,'rloess');
yy=yy2(ind);
xAbove(1)==xx(1);
yAbove(1)==yy(1);
plot(xx,yy,'r-')
0 comentarios
Respuesta aceptada
KSSV
el 20 de En. de 2021
load dataA.mat
%x1=dataA(:,1);
%y1=dataA(:,2);
f1 = fit(xAbove,yAbove,'smoothingspline','SmoothingParam',0.0001);%smoothingspline
%plot(f1,xAbove,yAbove)
% plot(f1,'-r')
xx1 = xAbove ;
yy1 = f1(xx1) ;
hold on
load dataB.mat
%x2=dataB(:,1);
%y2=dataB(:,2);
[xx,ind] = sort(xBelow);
yy2 = smooth(xBelow,yBelow,0.5,'rloess');
yy=yy2(ind);
xAbove(1)=xx(1);
yAbove(1)=yy(1);
xx = [xx1 ; flipud(xx) ; xx1(1)] ;
yy = [yy1 ; flipud(yy); yy1(1)] ;
plot(xx,yy,'r-')
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Least Squares 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!