
Plotting average value with max-min area
38 views (last 30 days)
Show older comments
Hello everyone,
I am having some trouble with MATLAB plots. I have successfully created an array
Cn_range=zeros(3,11);
and I filled it with minimum values in the first line, average values in the second line and maximum values in the third. What I need to plot is a solid line with the average values and a "shaded" range behind that, the boundaries of which are defined by the max and min values. I know all the "hold on" stuff, but I cannot find a plotting function for the shaded range behind. Is there anything that I could use to do that?
Thank you in advance for your attention and help.
0 Comments
Answers (1)
KALYAN ACHARJYA
on 2 Dec 2021
Edited: KALYAN ACHARJYA
on 2 Dec 2021
c_color=['r','m','y'];
for i=3:-1:1
p=Cn_range(i,:);
plot(p);
area(p,'FaceColor',c_color(i));
hold on;
end
Example:

Hope it helps!
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!