bar of mean of last 3 entries for 2 data sets

12 views (last 30 days)
Quinten
Quinten on 8 Apr 2024 at 22:52
Edited: Star Strider on 9 Apr 2024 at 0:21
Hi im really really new at coding, beware
Im working on trying to make a bar graph of 2 data sets. I managed to plot the means for the whole set but I also need to bar plot for the mean of rows 28:30, but I cant make it spit out correctly. anything would be helpful, thank you.

Answers (1)

Star Strider
Star Strider on 9 Apr 2024 at 0:08
Edited: Star Strider on 9 Apr 2024 at 0:21
It would help to have your data.
Perhaps something like this —
Data1 = randn(30) + randn(30,1);
Data2 = randn(30) + randn(30,1);
Data1Mean = mean(Data1,2);
Data2Mean = mean(Data2,2);
figure
bar([Data1Mean Data2Mean])
grid
figure
bar(28:30, [Data1Mean(28:30) Data2Mean(28:30)])
grid
EDIT — (9 Apr 2024 at 00:21)
Forgot about second data set. Now added.
.

Categories

Find more on Environment and Settings in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!