11智能在线
新记
MATLAB如何绘制不等式图形并填充颜色
1=<x<=30;
0=<y<=1;
sqrt(x)*y<=1;
举报该文章
相关建议 2015-03-19
close all;
x = 0:0.1:50;
y = 1./sqrt(x);
plot(x,y,'k','linewidth',2);
ylim([0,3]);
hold on;
line([0 50],[1 1]);
line([1 1],[0 3]);
line([30 30],[0 3]);
x1=1:0.1:30;
y1=1./sqrt(x1);
fill([1 1 x1 30 0],[0 1 y1 0 0],'r');
温馨提示:内容为网友见解,仅供参考
当前网址:
https://11.t2y.org/zz/8mp7fsss8mqf2vms72.html
其他看法
第1个回答 2017-06-17
[x,y]=meshgrid(linspace(1,30),linspace(0,1));
contourf(x,y,1-sqrt(x).*y,[0 0],'facecolor','r');
第2个回答 2015-03-19
可以尝试一下fill函数
追问
你好,用fill试过了,填充出来的形状不对。你可以把程序写下吗
相似回答
大家正在搜
相关问题
怎样在matlab中画矩形并填充颜色?
matlab如何给一个隐函数画出的封闭图形填充颜色?
如何用matlab求图形边界和对图形进行填充
Matlab里如何画出图中这种不规则的网格图,并对其填色呢?
请教:如何在matlab中把2个曲线之间的部分填充为别的颜色...
在matlab中画出圆,如何给其填充颜色?
matlab画不等式组的图
matlab fill函数的绘图颜色怎样设定?