function str = string_clean ( string ) str=regexprep(string,'#',''); str=regexprep(str,'\s+',' '); str=regexprep(str,'\.','_'); str=regexprep(str,'\(','_'); str=regexprep(str,'\)',''); endfunction function data = read_diagnostic(skip) % skip = lines to skip pkg load io; file = "../diagnostics.log"; F=fopen(file,"r"); titles=fgetl(F); fclose(F); titles=string_clean(titles); % remove spaces and so on titles=regexprep(titles,' ',' data.'); % prepare the command to evaluate titles=strcat("data.",titles); cmd="["; cmd=strcat(cmd,titles); format="%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s"; cmd=strcat(cmd,sprintf("] = textread(file,format,\"headerlines\",%d);",1+skip)); eval(cmd) endfunction