problem using stem command

조회 수: 1 (최근 30일)
Muhammad Haziq
Muhammad Haziq 2018년 12월 6일
댓글: Star Strider 2018년 12월 6일
Hi,
I want to plot some point by using stem comand but I recieve error. can any body guide me. point are lev_press and I need to mark them in between rec_start and rec_stop.
error:
Subscript indices must either be real positive integers or logicals.
Error in example (line 87)
stem(x,lev_press(1,r),':diamondr')
data
rec_start = 1.625608000000000e+03;
rec_stop=1.655613000000000e+03;
x = rec_start:1:rec_stop;
lev_press=[1629.599, 1630.297, 1633.178];
for r = lev_press 1:1:3
figure
stem(x,lev_press(1,r),':diamondr')
end

채택된 답변

Star Strider
Star Strider 2018년 12월 6일
Try this:
rec_start = 1.625608000000000e+03;
rec_stop=1.655613000000000e+03;
lev_press=[1629.599, 1630.297, 1633.178];
x = linspace(rec_start, rec_stop, numel(lev_press));
figure
stem(x, lev_press)
grid
ylim([1600 1650]) % Optional (‘Zooms’ Plot)
The ylim call makes the slight variation in the ‘lev_press’ values more visible.
  댓글 수: 6
Muhammad Haziq
Muhammad Haziq 2018년 12월 6일
Hi,
Thanks for the reply and helping me, this resolve my problem.
Regards,
Haziq
Star Strider
Star Strider 2018년 12월 6일
As always, my pleasure.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by