需要预先安装matlab curving fitting tool。
直接上代码
x1 = [1.0 1.0 1.2 3.0 5.8 7.2 7.4];
y1 = [283 283 278 215 90 37 0];
x2 = [0.5 0.5 0.5 0.6 1.9 5.8 6.6 6.7];
y2 = [145 145 148 145 145 110 28 0];
values1 = spcrv([[x1(1) x1 x1(end)];[y1(1) y1 y1(end)]],3,1000);
values2 = spcrv([[x2(1) x2 x2(end)];[y2(1) y2 y2(end)]],3,1000);
plot(values1(1,:),values1(2,:),'r',values2(1,:),values2(2,:),'b');
xlabel('F')
ylabel('v')
效果如图
还可以在实时编辑文本中进行标签代码生成等操作