读取OpenFOAM中每个文件夹的时刻的函数,每次都用的时候都找不到,这次放在网上。。。
function time1 = importfile1(filename, dataLines)
%IMPORTFILE1 Import data from a text file
% TIME1 = IMPORTFILE1(FILENAME) reads data from text file FILENAME for
% the default selection. Returns the numeric data.
%
% TIME1 = IMPORTFILE1(FILE, DATALINES) reads data for the specified row
% interval(s) of text file FILENAME. Specify DATALINES as a positive
% scalar integer or a N-by-2 array of positive scalar integers for
% dis-contiguous row intervals.
%
% Example:
% time1 = importfile1("/nfsdata6/RQLi/1-PRB-Flow/Ra7_Re3.75_2pi_f001_A2-new/0.4086/uniform/time", [18, 18]);
%
% See also READTABLE.
%
% Auto-generated by MATLAB on 29-Mar-2024 20:18:07
%% Input handling
% If dataLines is not specified, define defaults
if nargin < 2
dataLines = [18, 18];
end
%% Set up the Import Options and import the data
opts = delimitedTextImportOptions("NumVariables"