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

opts = delimitedTextImportOptions("NumVariables", 4);

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

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

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

% 指定变量属性
opts = setvaropts(opts, "A010", "WhitespaceRule", "preserve");
opts = setvaropts(opts, "A010", "EmptyFieldRule", "auto");

% 导入数据
smallsites1 = readtable("D:\EM_work\MT3D\DTM1\inv\small_sites2.dat", opts);
rec = table2array(smallsites1(:,2:4));
save rec rec ;

%
%% 清除临时变量

clear opts