フィルターのクリア

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 回表示 (過去 30 日間)
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-')

採用された回答

KSSV
KSSV 2021 年 1 月 20 日
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 件)

カテゴリ

Help Center および File ExchangeLeast Squares についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by