简体   繁体   中英

matlab - graph plotting

I have two arrays to plot, in x axis: array a . In y axis array b (ones and zeros)

I want to plot vertical lines when the values of array b =1 ie

a=[23 12 76 43 21 90]
b=[1 0 1 1 0 1]

You may try bar plot .

a=[23 12 76 43 21 90];
b=[1 0 1 1 0 1];
bar(a,b)

条形图

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM