surfPlot(data,varar​gin)

版本 1.2.0.0 (1.0 KB) 作者: Ambroise
Use surf function easily from a data matrix
116.0 次下载
更新时间 2015/7/14

查看许可证

The surf function requires a certain variable format. here is a function that allows you to plot data from a n*3 matrix using the surf function.
to be used for example with a data matrix of the form [time, position, temperature] or [position in x, position in y, concentration]
Help of the function:
surf plot from [x, y, z] data
data is in the form data = [x, y, z]; where x, y, and z are column vectors
This code works for an input dataset were x and y are like the following :
x only contains n values
y only contains m values
x contains m times all the different n values => length(x)=m*n
y contains n times all the different m values => length(y)=n*m
z contains the corresponding z value for each of those (x;y) points
=> length(z) = m*n
Example : (notice that x is either 1,2 or 3, y is 1,2,3 or 4)
data= [1 1 4.5;...
1 2 5 ;...
1 3 6;...
1 4 7;...
2 1 4.6;...
2 2 5.3;...
2 3 6.4;...
2 4 7.1;...
3 1 5;...
3 2 6;...
3 3 7;...
3 4 8];

引用格式

Ambroise (2025). surfPlot(data,varargin) (https://ww2.mathworks.cn/matlabcentral/fileexchange/51097-surfplot-data-varargin), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2011b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Surface and Mesh Plots 的更多信息
致谢

启发作品: sub images

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.2.0.0

h=surfPlot(data) returns now a handle to a chart surface graphics object.
Optional options for surf now supported

1.1.0.0

more efficient code, shorter, thanks to Stephen

1.0.0.0