generate_run_log¶
- generate_run_log(structs, struct_names, varargin)¶
GENERATE_RUN_LOG Write a run-settings log file from a cell array of option structs
- Usage:
[run_ID, fname] = generate_run_log(structs, struct_names, ‘Name’, Value, …)
- Inputs:
structs : 1xV cell - option structures to log – required struct_names : 1xV cell of char - variable names for the structures – required
- Name-Value Pairs:
‘run_start’ : char - run start timestamp; if empty, generated from datetime (default: ‘’) ‘file_path’ : char - directory to write the log file into (default: ‘’) ‘write_file’ : logical - whether to write the log to disk (default: true) ‘verbose’ : logical - whether to echo the log to the command window (default: false)
- Outputs:
run_ID : char - unique identifier for the run (currently empty; retained for signature compatibility) fname : char - filename of the written log (‘run_settings_<timestamp>.txt’)
Example
struct_names = {‘opt_struct1’, ‘opt_struct2’};
opt_struct1.f1 = ‘asdf’; opt_struct1.f2 = 23; opt_struct1.f3 = [1 2 3 4 9454];
opt_struct2.f1 = {[1 23 4], ‘cheese’, 343, ‘a’}; opt_struct2.f2 = ‘this is a struct’; opt_struct2.f3 = ‘goat’;
structs = {opt_struct1, opt_struct2}; generate_run_log(structs, struct_names, ‘verbose’, true);
See also: create_log, struct2codestr
∿∿∿ Prerau Laboratory MATLAB Codebase · sleepEEG.org ∿∿∿