这个拟合的曲线,为什么第一条好第二条在图例中是一样.。
Afficher commentaires plus anciens
这个拟合的曲线,为什么第一条好第二条在图例中是一样的呢?
d=[500 1000 1500 2000 2500];
t1=[0.299 0.566 0.841 1.117 1.393];
d.^2;
t1.^2;
scatter(d.^2,t1.^2)
hold on
p1=polyfit(d.^2,t1.^2,1);
f1=polyval(p1,d.^2);
plot(d.^2,t1.^2,'r-*')
t2=[0.364 0.517 0.701 0.897 1.099];
t2.^2;
scatter(d.^2,t2.^2)
p2=polyfit(d.^2,t2.^2,1);
f2=polyval(p2,d.^2);
plot(d.^2,f2,'b-s')
t3=[0.592 0.638 0.708 0.799 0.896];
t3.^2;
scatter(d.^2,t3.^2,[0.25 0.25 0.25])
p3=polyfit(d.^2,t3.^2,1);
f3=polyval(p3,d.^2);
plot(d.^2,t3.^2,'g-d')
legend('第一条','第二条','第三条',2)
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Legend dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!