## Rescue data saved as textfile by Octave-2.1.69 by re-saving it in ## Matlab format. ## ## Original files are kept. To the name of the new file '.mat' is ## appended. Script is to be used from the command line with ## Octave-2.1.69. if (! exist ('OCTAVE_VERSION') || ! strcmp (OCTAVE_VERSION, '2.1.69')) error ("updat.m: wrong octave version"); endif if (nargin != 1) error ("updat.m: wrong number of arguments"); endif ## Pray no variable in the file starts with ten '_'. __________vars = load (argv{1}); __________fds = fieldnames (__________vars); __________n = length (__________fds); __________ev_str = strcat ('save -mat ', argv{1}, '.mat'); for __________id = 1:__________n eval (strcat (__________fds{__________id}, ' = __________vars.', \ __________fds{__________id}, ';')); __________ev_str = strcat (__________ev_str, ' ', \ __________fds{__________id}); endfor eval (__________ev_str);