plotting Data vs timeline

조회 수: 4 (최근 30일)
Philip Bukovcan
Philip Bukovcan 2019년 8월 22일
답변: Prabhan Purwar 2019년 8월 26일
Greetings!
I would like to plot some Data against a timeline and I kind of managed to do so, but with the problem that I also plot the time itself in the Diagram.
Is there a possibility to hide the Timedata in the Diagram? Or do I need to change the Code?
I attached the Diagram just for clarification of the Problem.
Data = xlsread('Repräsentative Profile VDEW.xls','H0','B4:B99');
Time = xlsread('Repräsentative Profile VDEW.xls','H0','A4:A99');
order = 3;
framelen = 11;
sgf = sgolayfilt(Data,order,framelen);
xlabel('TIme');
ylabel('Power');
plot(Time,Data)
datetick('x', 'HH:MM')
hold on
plot(Time,sgf,'.-')
legend('signal','sgolay')
Thank you in Advance!
  댓글 수: 2
Bob Thompson
Bob Thompson 2019년 8월 22일
What do you mean by 'I also plot the time itself in the Diagram?' It seems like you are looking to plot your data against time, which by definition means that time information is being displayed. Is there a different 'time' you are referring to?
Philip Bukovcan
Philip Bukovcan 2019년 8월 22일
I have Data concerning the need of Power for households over a whole day and I already achieved in plotting it against time in the Diagram shown in the attached files.
My Problem is that I have an additional "curve" (the straight line) in the Diagram which I want to get rid off. I think this line is resulting out of the Time Data I am inserting.

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

채택된 답변

Prabhan Purwar
Prabhan Purwar 2019년 8월 26일
Hey,
The straight line is appearing in the graph because of the interpolating nature of the plot() function.
Data extracted from the excel file is as follows (according to the given figure).
But, because of the interpolative nature of the plot(), there occurs a line joining consecutive data points (0.98958,101.5594) and (0,93.3783).
The sgolayfilt() is responsible for smoothing of the signal.
You may get rid of line either by deleting or appending y=93.3783 at the starting.

추가 답변 (0개)

카테고리

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

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by