fill area between two curves
Ältere Kommentare anzeigen
Hello,
I have two PSD graphs and I want to fill the area between them.

I used this code but it didn't work properly:
figure(3)
x2 = [f2(321:1921,:), fliplr(f2(321:1921,:))];
inBetween = [yconf(321:1921,1), fliplr(yconf(321:1921,2))];
fill(x2, inBetween, 'g');

Does anyone know how I can fix it?
Thanks,
Amir
Akzeptierte Antwort
Weitere Antworten (1)
Davide Masiello
am 16 Mär. 2022
Bearbeitet: Davide Masiello
am 16 Mär. 2022
I think the problem might be that your y-values are column vectors, and therefore you create a matrix when you concatenate them using the comma.
Maybe this will work
figure(3)
x2 = [f2(321:1921,:), fliplr(f2(321:1921,:))];
inBetween = [yconf(321:1921,1)', fliplr(yconf(321:1921,2))'];
fill(x2, inBetween, 'g');
Kategorien
Mehr zu Graphics Object Properties finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


