How can I mark wheezes on a plot?

조회 수: 2 (최근 30일)
Serhat Sayim
Serhat Sayim 2020년 11월 27일
답변: Star Strider 2020년 11월 27일
wsnew is our wheezing starting indexes,wenew is our wheezing ending indexes.
How can I mark these indexes on the plot?

답변 (1개)

Star Strider
Star Strider 2020년 11월 27일
Try something like this:
wheezes = sort(randi(100, 10, 1)); % Create Data
wsnew = wheezes(1:2:end); % Create Data
wenew = wheezes(2:2:end); % Create Data
x = linspace(0, 100, 100);
breathsounds = rand(size(x));
figure
plot(x, breathsounds)
hold on
plot(x(wsnew*[1 1]).', (ones(size(wsnew,1),2).*ylim).', '-g', 'LineWidth',2)
plot(x(wenew*[1 1]).', (ones(size(wenew,1),2).*ylim).', '-r', 'LineWidth',2)
hold off
grid
.

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by