필터 지우기
필터 지우기

Plot different signals in a single plot using days as reference on the x-aixs

조회 수: 5 (최근 30일)
I need to plot (two months days/60 days data) many signals in one graph, for example: 1st signal has 50,000 data points for 2 months, 2nd signal has 30,000 data points for 2 months, 3rd signal has 4,000 data points for 2 months, so on and so forth...
http://i.imgur.com/A1eB4rY.png from the figure, some of the signals falling shorter than the one has more data points. So it plots against the data points but I need to plot against day as a reference, please provide me a suggestions on this, thanks in advance

채택된 답변

Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2014년 8월 13일
Hi Ramas,
I guess I understood your prob.
You have to calibrate the X axis according to your highest number of data points which is apparently 50000
so make the days as such for each data set.
days = linspace(0,60,numel(sig1));
which is equal to
days = linspace(0,60,50000);
if assumming that sig1 has 50000 data
then you have to plot as follow for each data set
plot(days,sig1)
Hope you get it and that helps.
Good Luck!
  댓글 수: 2
Ramas Sami
Ramas Sami 2014년 8월 13일
Thanks @Salaheddin Hosseinzadeh, your solution gives good directions really I didn't think of, let me work out and get back to you with the results.
Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2014년 8월 13일
I'm glad that you found the way.
BTW, you can change the axis ticks to make them from 1 to 60 on X axis
axesHandle = axes(); % creating axes for plot
or take the handle of current axes
axesHandle = gca;
then
xlim(axesHandle,[1,60]); % defining axes limit
days = 1:x:60; % change x to 2 and it would be every other day
set(axesHandle,'XTick',days);

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

추가 답변 (1개)

dpb
dpb 2014년 8월 13일
Convert the dates to Matlab datenum, plot against them and use datetick to create the time-basis x-axis.
Examples are in doc's for
doc datenum % and friends
doc datetick

카테고리

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

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by