fill area between two curves
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (1)
Davide Masiello
el 16 de Mzo. de 2022
Editada: Davide Masiello
el 16 de Mzo. de 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');
Categorías
Más información sobre Graphics Object Properties en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


