MATLAB Answers

How can I plot an average line through this line graph

조회 수: 476(최근 30일)
KJones
KJones 26 Oct 2016
답변: Marco Wassmer 26 Oct 2016
How can i plot the average of these line graphs onto the same graph?

  댓글 수: 0

로그인 to comment.

채택된 답변

Marco Wassmer
Marco Wassmer 26 Oct 2016
assuming your data is stored in the vectors x1....x8 of the same length:
sum each component and divide by the number of lines:
x_mean=sum([x1,x2,x3,x4,x5,x6,x7,x8],2)./8
The plot in the plot:
plot(gca,time,x_mean);
if your time vectors are not the same then you will have to interpolate

  댓글 수: 0

로그인 to comment.

추가 답변(1개)

Thorsten
Thorsten 26 Oct 2016
You store the values of each line in the rows of matrix X. Then use
plot(mean(X))

  댓글 수: 0

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.

태그


Translated by