Mathworks File Exchange频道近期更新了一个小函数。能够将三维数据矩阵相应的函数u=f(x,y,z)可视化的显示出来。
对我们这些常和数据分析问题打交道的人爱说。还是有点參考价值的.....把它放到这里,供大家參考
1.链接:
http://www.mathworks.com/matlabcentral/fileexchange/48483-3-dimensional-data-visualization?utm_campaign=Feed%3A+mathworks%2FqkjK+%28MATLAB+Central+-+File+Exchange+-+Most+Recent+Files%29&utm_medium=feed&utm_source=feedburner
2.函数的语法格式:
function h=view3d(data,exponent,maxsize,linewidth)
3.各个參数的说明
% data: Input data(3 dimensional) % exponent: Exponential scaling factor for values( greater than 1) % maxsize: Maximum point size % line Edge thickness of points %
4.调用实例
clc;clear all;close all; [x,y,z]=meshgrid(-1:0.25:1,-1:0.25:1,-1:0.25:1); t=exp(1-x.^2)+exp(1-y.^2)+exp(z.^2); view3d(t,1.4);
5.可视化效果
6.The end! Enjoy your happy moring!