Mathematica中文论坛-非官方

标题: 豆粑粑 matlab 3Dcontourslice [打印本页]

作者: meatball1982    时间: 2017-7-13 16:54
标题: 豆粑粑 matlab 3Dcontourslice
  1. clear,clc,close all

  2. t = (0:100)'/50*pi;

  3. % h=figure(1)
  4. x = cos(t) * [1 2 2 1 1];
  5. y = sin(t) * [1 2 2 1 1];
  6. z = repmat([1 1 -1 -1 1]*.6, numel(t), 1);
  7. [xi,yi,zi] = meshgrid(-2:.1:2);
  8. v = exp(- cos(xi).^2 - cos(yi).^2 - cos(zi).^2);

  9. surf(x, z, y, 'FaceColor', [1 1 1]*.7, 'EdgeColor', 'none'), hold on
  10. plot3(x, z, y, 'k', 'Linewidth', 1), camlight head
  11. set(contourslice(xi, yi, zi, v, x, z, y), 'EdgeColor', 'k'), axis image off
  12. h=gcf;
  13. fig_na='./fig_cont3D';
  14. fun_work_li_035_myfig_out(h,fig_na,3)
复制代码

http://www.ilovematlab.cn/forum. ... p;page=1#pid3244961比我NB










欢迎光临 Mathematica中文论坛-非官方 (http://ilovemathematica.com/) Powered by Discuz! X3.2