how can i plot 14 vertical lines at the same time??

i want plotting 14 vertical lines at the same time .is it possible??
load ecg.m;
n=length(ecg);
fs=360;
t=0:1/fs:(n-1)/fs;
CWTcoeffs = cwt(ecg,10:50,'sym4','plot');
colormap jet; colorbar;
ww=CWTcoeffs(15,:);
qrs_thr_on=[170 440 690 947 1201 1460 1720] ;
qrs_thr_end=[228 485 730 988 1245 1502 1765];
subplot(321);
plot(CWTcoeffs(15,:)); title('Scale 15');grid on;hold on
x=[170,170];
y=[-1500,1500];
plot(x,y,'--')

 採用された回答

Fangjun Jiang
Fangjun Jiang 2017 年 10 月 31 日

1 投票

line() can draw multiple lines at a time. You just need to pay attention to how to provide your data in the right format. For example, three vertical lines
line([2,3,4;2,3,4;],[0,0,0;1,1,1])

3 件のコメント

Good mind
Good mind 2017 年 10 月 31 日
編集済み: Stephen23 2017 年 10 月 31 日
thank you. but i get this error Dimensions of matrices being concatenated are not consistent.
line([170,228,440,485,690,730,947,988,1201,1245,1460,1502,1720,1765;170,228,440,485,690,730,947,988,1201,1245,1460,1502,1720,1765],[-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000-1000,-1000,-1000,-1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000]);
plot(line)
Stephen23
Stephen23 2017 年 10 月 31 日
編集済み: Stephen23 2017 年 10 月 31 日
@Khiter hind: the second matrix is missing a comma in the first row. You would have found this yourself if you had written your code in a neater way, e.g. by defining two variables, one for each input argument, and with the columns in each matrix aligned.
Also plot(line(..)) makes no sense: line already plots the data. Fangjun Jiang's answer does not need you to add any other functions to make it work.
Good mind
Good mind 2017 年 10 月 31 日
thank you, now it is ok

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGraphics Performance についてさらに検索

製品

質問済み:

2017 年 10 月 31 日

コメント済み:

2017 年 10 月 31 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by