Matlab read vtk file format

broken image
broken image

% size, each storing speeds in the a single Cartesian directions. % savevtkvector(X,Y,Z,filename) saves a 3-D vector of any size to % savevtkvector Save a 3-D vector array in VTK format % savevtk(array, filename) saves a 3-D array of any size toįprintf(fid, '# vtk DataFile Version 2.0\n') įprintf(fid, 'DATASET STRUCTURED_POINTS\n') įprintf(fid, 'DIMENSIONS %d %d %d\n', nx, ny, nz) įprintf(fid, 'ORIGIN 0.000 0.000 0.000\n') įprintf(fid, 'SPACING 1.000 1.000 1.000\n') įprintf(fid, 'POINT_DATA %d\n', nx*ny*nz) įprintf(fid, 'SCALARS scalars double\n') įunction savevtkvector(X, Y, Z, filename) % savevtk Save a 3-D scalar array in VTK format. They are shown below with some modification on my own: I was looking for some function to save matlab array to VTK data format, and found just what I wanted in this page. Oka Kurniawan Institute of High Performance Computing.