mphinterpolationfile
Save data in files readable by the Interpolation feature.
Syntax
mphinterpolationfile(filename,type,data)
mphinterpolationfile(filename,type,data,xdata)
mphinterpolationfile(filename,type,data,xdata,ydata)
Description
mphinterpolationfile(filename,type,data) saves the NxM matrix data into the text file filename with the format type. The interpolation coordinates are vectors with values from 1 to N and 1 to M.
mphinterpolationfile(filename,type,data,xdata) saves the vector data and the interpolation coordinate xdata into the text file filename with the format type.
mphinterpolationfile(filename,type,data,xdata,ydata) saves the matrix data and the interpolation coordinate vectors xdata and ydata into the text file filename with the format type.
type can be either 'grid', 'sectionwise' or 'spreadsheet'.
Example
Create random 10x10 interpolation data to file using grid format:
data = cumsum(0.1*randn(size(10)));
mphinterpolationfile('datagrid.txt','grid',data);
1D interpolation data to file using spreadsheet format:
t = 0:0.05:2*pi;
z = sin(cos(t)*4)+sin(51*t)*0.05;
mphinterpolationfile('dataspread.txt','spreadsheet',z,t);
2D interpolation data to file using sectionwise format:
z = magic(9); x = 1:9; y = 0:8;
mphinterpolationfile('datasection.txt','sectionwise',z,x,y);
See also
mphquad2tri, mphreadstl, mphsurf, mphwritestl