필터 지우기
필터 지우기

Error scaling x-axis in Matlab?

조회 수: 1 (최근 30일)
Soeun Lee
Soeun Lee 2021년 7월 20일
답변: Jonas 2021년 7월 20일
Hi. I would like to scale the x-axis (the time axis) in Matlab to start at 150 and end at 260. Below is my code and I keep getting the error "Error using xlim. Limits must be a 2-element vector with increasing durations.". How can I fix this? Thank you in advance!
threshold = -0.0001;
[pks,locs] = findpeaks(-neural.spikes,'MinPeakHeight',abs(threshold));
figure
plot(neural.Time,neural.spikes); hold on
line([min(neural.Time) max(neural.Time)],[threshold threshold],'color','r','LineWidth',1)
xlim([150 210]);
scatter(neural.Time(locs),-pks,'r'); hold off

답변 (1개)

Jonas
Jonas 2021년 7월 20일
your
neural.Time
variable is of type duration, then your xlim values have to be type duration too i guess

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by