xyzplotter

版本 1.4.0.0 (1.6 KB) 作者: Jack Kohoutek
Transforms lists xin,yin,zin into matrices which can be used with the functions surf and mesh.
1.8K 次下载
更新时间 2012/3/12

查看许可证

This file has been updated for a MUCH faster version on large arrays (100k elements plus).

Enjoy.

MATLABs most commonly used 3-d plotting tools surf and mesh require rectangular grids to plot in 3-d, not x,y,z triples. This function converts arrays of x,y,z triples into rectangular grids to use with surf, mesh, etc.

common usage:
[x y z] = xyzplotter(xin,yin,zin)

xin,yin,zin are n x 1 arrays that define your surface. So xin(1),yin(1),zin(1) is the first point in your surface, etc. They do not need to be in any particular order.

Missing values in the grid will be filled in with NaNs. If you would like to interpolate the NaNs, I suggest inpaint_nans, file exchange number 4551. Here is the link:
http://www.mathworks.com/matlabcentral/fileexchange/4551

Andrew Stephens contributed some good ideas to this code, mostly accumarray() and unique() which I didn't know existed before. For now I would like to acknowledge his generous contribution.

引用格式

Jack Kohoutek (2024). xyzplotter (https://www.mathworks.com/matlabcentral/fileexchange/25277-xyzplotter), MATLAB Central File Exchange. 检索时间: .

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

Community Treasure Hunt

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

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

This version is orders of magnitude faster than the last version, especially on large arrays.

1.3.0.0

This file has been updated for a MUCH faster version on large arrays (100k elements plus). Please see:

http://www.mathworks.com/matlabcentral/fileexchange/35428

Enjoy.

1.2.0.0

Updated code for a very large speed increase with more random datasets, thanks to some help from Andrew Stephens.

1.1.0.0

Addressed numbers 1-3 of the first comment. Thank you very much for the rating and feedback!

1.0.0.0