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;">

  • 相关阅读:
    面向切面编程AOP
    多线程:Monitor、synchronized、volatile
    约束布局ConstraintLayout
    【转】StackTraceElement获取方法调用栈的信息
    Java中的Type
    Android App 架构演变
    Java泛型
    web测试方法总结
    机器学习 损失函数
    深度学习 激活函数
  • 原文地址:https://www.cnblogs.com/stxs/p/8617234.html
Copyright © 2011-2022 走看看