FEATool  v1.6
Finite Element Analysis Toolbox
 All Files Functions Pages
impexp_ascii.m File Reference


IMPEXP_ASCII Import or export data in ascii format.

[ DATA ] = IMPEXP_ASCII( DATA_SPEC, DATA, FID_LOG ) Import or export DATA according to DATA_SPEC in ASCII format. If DATA is missing or empty export is assumed. FID_LOG specifies a message log file id (negative for gui output or empty for no output).

DATA_SPEC is a struct with the following optional fields

.pre - is a cell array of string commands to execute/evalutate before main processing.

.proc - is a cell array processed row by row for which the first column entry specifies a specific task/function and the following entires are arguments.

{command s_cmd} - Evaluates the string command S_CMD.

{funcall {s_vars} s_fun {args}} - Calls the function S_FUN with a cell array of input arguments ARGS, and a cell array of variable names for outputs in S_VARS.

{goto_line s_keyword} - Rewinds and scan file to find the line starting with S_KEYWORD. If S_KEYWORD is a cell STRCONV will be called to parse the line. In export/write mode the export it analogous to process_line.

{process_block s_var s_format siz} - Call FSCANF from current point with format S_FORMAT and optional argument SIZ. The output is assigned to the variable name in S_VAR. Writes block in ascii format in export mode.

{process_line {s_vars} s_format} - Reads line and calls STRCONV to convert into S_FORMAT (optional) and assigns result to variables in S_VARS. Writes variables in export mode.

{process_string {s_vars} s_format s_var} - Applies STRCONV to string variable S_VAR as above (instead of reading a new line).

{rewind} - Rewinds the file.

{string_line s } - Reads line to variable S_LINE import mode, or alternatively writes line in export mode.

OTHERWISE - The next line is read into the variable S_LINE or nothing in export mode.

.post - is a cell array of string commands to execute/evalutate after main processing.

Required fields of data_spec: