I have to shade the area between the two curves, i have used fill function including fliplr, but no success?

2 vues (au cours des 30 derniers jours)
filename = 'H2_5_20A only.xlsx'; A = xlsread(filename); current = A(:,1); time = A(:,2); h2high = A(:,3); h2low = A(:,4); yyaxis left; plot(time,h2high,'r', time,h2low,'b');
hold on; yyaxis left; fill([time fliplr(time)], [h2low fliplr(h2high)], 'r'); hold off;

Réponse acceptée

Aquatris
Aquatris le 20 Juil 2018
Modifié(e) : Aquatris le 20 Juil 2018
Here is how I did it;
t= 0:0.1:10;
y1 = sin(t);
y2 = sin(5*t)-6;
fill([t t(end:-1:1)],[y1 y2(end:-1:1) ]','r')

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by