zoukankan      html  css  js  c++  java
  • Matlab绘图基础——散点生成三角网(TIN)

    %例一:二维三角网TIN模型的生成
    X=rand(10,2)*5;
    dt=DelaunayTri(X(:,1),X(:,2));       %生成三角网
    triplot(dt);hold on;                 %绘图
    scatter(X(:,1),X(:,2),'o'),hold off  %将结点展示出来(散点)
     
    %例二:三维TIN的生成(由规则点生成)
    [x,y]=meshgrid(1:15,1:15);z=peaks(15);
    tri=delaunay(x,y);   %以X,Y为准生成Delaunay triangulation(三角网)
    trisurf(tri,x,y,z);  %将该三角网显示出来
    colormap autumn;     %方法一
    %If the surface is in the form of a TriRep 
    %triangulation representation, plot it as follows:
    %tr=TriRep(tri,x(:),y(:),z(:));trisurf(tr);  %方法二
    %plot3(x(:)', y(:)', z(:)')
    %例三:离散点生成TIN三角网模型
    A=rand(300,2)*20-10;X=A(:,1);Y=A(:,2);%X,Y的区间为[10,10]
    R=sqrt(X.^2 + Y.^2);Z=sin(R)./R;      %函数,计算对应点坐标的函数值
    tri=delaunay(X,Y);trisurf(tri,X,Y,Z); %以X,Y为准生成Delaunay triangulation(三角网)
    colormap jet;hold on
    scatter3(X(:),Y(:),Z(:),'r');hold off %将散点展示出来
     

    <wiz_tmp_tag id="wiz-table-range-border" contenteditable="false" style="display: none;">

  • 相关阅读:
    php+redis简易消息队列
    Linux关闭selinux的方法(临时关闭和永久关闭)
    Linux清理buff/cache
    Centos禁止ping的设置方法
    浅谈mysql触发器
    mysql中left join right join inner join用法分析
    mysql主从配置详解(图文)
    mysql中的几种判断语句
    mysql锁表处理方法
    Mysql里的order by与索引
  • 原文地址:https://www.cnblogs.com/stxs/p/8617234.html
Copyright © 2011-2022 走看看