How can I shift the time series in y axis?

Hi,
The time series that have been used are obtained from accelerometer in a building. I want to plot the time series or fourier amplitude spectra according to the floors in which they are recorded just like in this picture. Yet, I don't know how to shift the series in y axis.
Thanks for reading!

 채택된 답변

Ahmed
Ahmed 2013년 6월 10일

0 개 추천

Shift in y-direction just by adding 1,2,...,nFloors to each data line.
N = 100;
nFloors = 5;
x = 1:N;
y = bsxfun(@plus,rand(nFloors,N),(1:nFloors)');
plot(x,y);
set(gca,'YTick',(1:nFloors)+0.5);
set(gca,'YTickLabel',{'floor1' 'floor2' 'floor3' 'floor4' 'floor5'});

댓글 수: 1

madreperla
madreperla 2013년 6월 10일
Thank you very much Ahmed! This is very very useful!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Frequently-used Algorithms에 대해 자세히 알아보기

질문:

2013년 6월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by