% Matlab program for displaying waveforms % % Graphics initialization % Extract section from data file cd /tmp; % fprintf(fopen('ping', 'w'), 'I am here.'); !zcat {data_dir_long}/{file}.data.Z|{html_dir_long}/chuck {start}|{html_dir_long}/keep {length}>{temp_file}; x = [{start}:{start}+{length}-1]; % Load the file's contents load -ascii {temp_file}; % Determine how many channels [m n] = size({temp_file}); if n == 1 % Single channel data plot(x, {temp_file},'r'); xlabel('Sample Number'); ylabel('Amplitude'); title('Waveform plot of {data_dir_short}/{file}'); set(gcf, 'PaperType', 'a5'); orient tall; else for i=1:n subplot(n, 1, i); plot(x, {temp_file}(:,i),'r'); set(gca, 'TickDir', 'out'); if i == 1 title('Waveform plot of multichannel data {data_dir_short}/{file}'); end if i == n xlabel('Sample Number'); else set(gca, 'XTickLabels', ' '); end ylabel(sprintf('Channel %d', i)); end set(gcf, 'PaperType', 'a5'); orient tall; end % Create output file print -dgif8 '/tmp/{gif_file}'; % Clear figure & reset all its properties (except Position) clf reset % Delete temporary files !rm {temp_file}; !rm /softlib1/htdocs/spib/spib{temp_file}.m;