TA的每日心情 | 怒 2019-11-29 15:37 |
|---|
签到天数: 1 天 [LV.1]初来乍到
|
可以同时修改颜色和粗细,使各组线有一个变化的效果。. l& @" w( g/ M5 e
1 c8 V5 O5 W6 k7 [4 F2 @# b
clear all
+ U7 f: R7 i+ N& t Hclc
. G; }9 }: S hclf
% f" {! L% K0 R7 v" c9 p3 w& J# ^1 c9 `
x=1:0.2: (2*pi);7 u+ B. X2 }7 i
hold on
3 E9 M7 t( {; B. u" ifor i=1:9
0 d# x& c! a7 f: x0 k y=sin(x+i*pi/10)+exp(x/5);' ~* x) Y# B( U
plot(x,y,'.-','Color',[(0.7+0.1/i)^2 1-(0.1*i) 0.5/i^2],'LineWidth',2+0.5*i);: `( W: e' H1 L& h2 m3 G
str{i}=['H=',mat2str(i*0.01)];
" w2 f& r! k1 Vend8 ?4 b: D2 S$ l! X; S
legend(str)3 B/ L* R' c3 F1 B
hold off( g0 Z" K4 d H1 H. p& x1 j
6 A% S6 M# E- a
7 t7 F/ n' U: z& o6 U7 T2 o
|
|