Filter löschen
Filter löschen

How can I plot an average line through this line graph

91 Ansichten (letzte 30 Tage)
KJones
KJones am 26 Okt. 2016
Beantwortet: Marco Wassmer am 26 Okt. 2016
How can i plot the average of these line graphs onto the same graph?

Akzeptierte Antwort

Marco Wassmer
Marco Wassmer am 26 Okt. 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

Weitere Antworten (1)

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

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by