目的:实现曲线之间的填充。
效果图:
代码:
clear;clc;
x = 0 : 0.1 : 4 * pi;
ls = length(x);
y1 = sin(2*x);
y2 = sin(x);
hold on;
plot(x, y1);
plot(x, y2);
maxY = max([y1; y2]);
minY = min([y1; y2]);
yFill = [maxY, fliplr(minY)];
xFill = [x, fliplr(x)]; % fliplr函数:左右翻转
fill(xFill, yFill, 'c');
hold off
---------------------
作者:有个家伙喜欢代码
来源:CSDN
原文:https://blog.csdn.net/u012366767 ... 066?utm_source=copy
版权声明:本文为博主原创文章,转载请附上博文链接!
|
|