设为首页收藏本站

EPS数据狗论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1631|回复: 0

matlab 绘制皮亚诺曲线

[复制链接]

19

主题

162

金钱

253

积分

入门用户

发表于 2019-8-9 15:07:26 | 显示全部楼层 |阅读模式

matlab 绘制皮亚诺曲线
  1. function peano_curve(n)  
  2.     peano_old=[0,0;0,1;0.5,1;0.5,0;1,0;1,1];  
  3.     x=peano_old(:,1);  
  4.     y=peano_old(:,2);  
  5.     figure  
  6.     set(gcf,'position',[0,0,1920,1080]);  
  7.     plot(x,y)  
  8.     axis equal  
  9.     for i=1:n-1  
  10.         p1=[peano_old(:,1),2+1/(3^i-1)-peano_old(:,2)];  
  11.         p1=p1(length(p1):-1:1,:);  
  12.         p2=[p1(:,1),4+3/(3^i-1)-p1(:,2)];  
  13.         p2=p2(length(p2):-1:1,:);  
  14.         peano_new=[peano_old;p1;p2];  
  15.         p1=[2+1/(3^i-1)-peano_new(:,1),peano_new(:,2)];  
  16.         p1=p1(length(p1):-1:1,:);  
  17.         p2=[4+3/(3^i-1)-p1(:,1),p1(:,2)];  
  18.         p2=p2(length(p2):-1:1,:);  
  19.         peano_new=[peano_new;p1;p2];  
  20.         peano_old=peano_new/(3+2/(3^i-1));  
  21.         x=peano_old(:,1);  
  22.         y=peano_old(:,2);  
  23.         plot(x,y)  
  24.         axis equal  
  25.         pause(1)  
  26.     end  
  27. end
复制代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

客服中心
关闭
在线时间:
周一~周五
8:30-17:30
QQ群:
653541906
联系电话:
010-85786021-8017
在线咨询
客服中心

意见反馈|网站地图|手机版|小黑屋|EPS数据狗论坛 ( 京ICP备09019565号-3 )   

Powered by BFIT! X3.4

© 2008-2028 BFIT Inc.

快速回复 返回顶部 返回列表