作者aada (aada)
看板MATLAB
标题Re: [问题] 绘图 hold on 取部分图
时间Mon Mar 24 09:33:14 2014
tx0=10:0.1:12;
tx1=11:0.1:13;
ty=sin(tx0);
avg = min(tx0)+(max(tx1)-min(tx0))/2
tx0_1 = find(tx0(:)==avg)
tx1_1 = find(tx1(:)==avg)
figure(3)
plot(tx0(1:tx0_1),ty(1:tx0_1),'b',tx1(tx1_1:21),ty(tx1_1:21),'b')
打完收工, 不晓得还有没有更精简的版本~
※ 引述《danny3652003 (发哥)》之铭言:
: 如果我有程式码如下
: tx0=10:0.1:12;
: tx1=11:0.1:13;
: ty=sin(tx0);
: plot(tx0,ty,'b')
: hold on
: plot(tx1,ty,'b')
: 此为两条线
: 想将它变成一条如
: figure(2)
: plot(tx0(1:16),ty0(1:16),'b')
: hold on
: plot(tx1(6:21),ty0(6:21),'b')
: 这样的图
: 要怎麽去掉交线以上
: 只能数格子吗...
: 或是有其他写法?
: 感谢
--
请选出一个「最不恰当的」答案填入空格当中。
1.童颜___。
(A)鹤发 (B)巨乳 (C)无忌 (D)皓首
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 111.235.221.32
1F:推 danny3652003:@@ 谢谢你~~我知道怎麽找点了~~感恩 03/24 10:35
2F:→ aada:OK 03/24 11:43