WriteToVTK
Version 1.0.0.0 (917 Bytes) by
Tim
Write 3D matrices to VTK files viewable with Paraview.
4.4K Downloads
Updated
24 Mar 2009
No License
This writes a 3D matrix to a VTK file. An old text-based format is used because it is easy to write to. This may result in very large file sizes.
The matrix is normalised, kind of. Not sure why I did that; it might not be needed. The code is very short so feel free to experiment!
Usage:
WriteToVTK(matrix, filename)
Example:
m = reshape(magic(6), [3 3 4]);
WriteToVTK(m, 'magic.vtk');
Cite As
Tim (2026). WriteToVTK (https://uk.mathworks.com/matlabcentral/fileexchange/23416-writetovtk), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2008a
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Graphics > 2-D and 3-D Plots > Vector Fields >
Find more on Vector Fields in Help Center and MATLAB Answers
Tags
Acknowledgements
Inspired: Write 2D and 3D Arrays into VTK, Write Cell Array of Structs into a VTK Structured Grid
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
