在MatLab中画彩虹

 时间:2024-10-13 14:38:47

1、思路1. 画8个不同半径的圆2. 定义8中不同的填充颜色3. 利用fill填色,从半径最大的开始,由外往内,这样做可以让后面填色的覆盖之前填色

2、具体代码figure;pause(5);t=0:0.001:pi;x=8*cos(t);y=8*s足毂忍珩in(t);fill(x,y,'r');hold on;x=7*cos(t);y=7*sin(t);patch(x,y,[1 0.5 0]);hold on;x=6*cos(t);y=6*sin(t);fill(x,y,'y');hold on;x=5*cos(t);y=5*sin(t);fill(x,y,'g');hold on;x=4*cos(t);y=4*sin(t);patch(x,y,[ 0.5843 0.8157 0.9882]);hold on;x=3*cos(t);y=3*sin(t);fill(x,y,'b');hold on;x=2*cos(t);y=2*sin(t);patch(x,y,[0.4039 0.0078 0.3686]);t=0:0.01:pi;x=cos(t);y=sin(t);fill(x,y,'w');plot([-1 1],[0 0],'w');axis equal;

3、结果展示

在MatLab中画彩虹
  • Mathematica基础——字符串操作初步
  • MATLAB使用importdata读取字符数据文件并绘图
  • 如何在MATLAB中获得table的数据量?
  • matlab特殊字符的标记
  • 如何在MATLAB中获取数组信息
  • 热门搜索
    飘邈之旅游戏 苏州国际旅游节 山西旅游团 巴厘岛旅游地图 上海旅游集散中心网站 塞维利亚旅游 黄石公园旅游 仁化旅游景点大全 大连旅游职业中专 金孔雀旅游度假村