%% 从文本文件中导入数据
% 用于从以下文本文件中导入数据的脚本:
%   filename: D:\EM_work\MT3D\DTM1\inv\small2.dat
% 由 MATLAB 于 2023-05-05 23:20:10 自动生成
%% 设置导入选项并导入数据

opts = delimitedTextImportOptions("NumVariables", 3);

% 指定范围和分隔符
opts.DataLines = [1, Inf];
opts.Delimiter = "\t";

% 指定列名称和类型
opts.VariableNames = ["VarName1", "VarName2", "VarName3"];
opts.VariableTypes = ["double", "double", "double"];

% 指定文件级属性
opts.ExtraColumnsRule = "ignore";
opts.EmptyLineRule = "read";

% 导入数据
small2 = readtable("D:\EM_work\MT3D\DTM1\inv\small2.dat", opts);

p = table2array(small2);
save topoxyz.txt -ascii p ;

%
%% 清除临时变量

clear opts