我在两个部分中绘制了一条拟合曲线段。但是在中间有重叠,为了拟合曲线,我在数据集的第三和第四点添加了一个名为x的点,曲线的第一部分使用了[tre(1:3),x]和日期集的第二部分使用了[x,tre(4:6)],因此拟合曲线在x和第四部分重叠,因此我该如何绘制拟合曲线的一部分[! [] {{3} }
x=tr1(3)+0.5*(tr1(4)-tr1(3)); %fetch the middle point of third and fourth
y=d(3)+0.41*(d(4)-d(3));
d1=[d(1:3),y]'; %added to the data set
tro=[tr1(1:3),x]';
hold on
Fits2{p}=fit(tro,d1,'poly3'); %fit curve p=1
plot(Fits2{p},S1{p},tro, d1, C1{p});legend('off'); draw the first section
I want to draw the fitted curve from the first to the third points
tre1=[tr1(3),x,tr1(4:6)]'; %add to the second part of the curve of data set
de1=[d(3),y,d(4:6)]';
Fits3{p}=fit(tre1 ,de1,'exp2'); fit corve p=1
plot(Fits3{p},S1{p},tre1, de1,C1{p}); legend('off');
%I want to draw the fitted curve of x to sixth point to get rid of the two section not to overlap
如何绘制拟合曲线的一部分