网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 时尚美容

Matlab如何使用代码添加图例(legend)

时间:2024-10-21 20:48:06

1、如图所示,首先打开matlab软件。

Matlab如何使用代码添加图例(legend)

3、输入以下代码。x = 0:pi/50:2*pi;y = sin(x);y1=cos(x);figur髫潋啜缅e plot(x,y,'r')hold onplot(x,y1,'b')

Matlab如何使用代码添加图例(legend)

5、如图所示,在上述代码中加入一行代码:legend('a','b');

Matlab如何使用代码添加图例(legend)
© 海能知识库