function [timeSeries, hij] = testmakeh(simId, varargin)

% $Id: testmakeh.m,v 1.4 2004/05/11 15:08:06 stuver Exp $

addpath ../

hij = makeh(simId, 1e-21, 1, 16384);
% Assumes a sampling rate of 16384 samples per second

timeSteps = size(hij, 3);

if length(varargin) == 0
    
    for iTimeStep = 1:timeSteps
        timeSeries(1,iTimeStep) = hij(1,1,iTimeStep);
        timeSeries(2,iTimeStep) = hij(1,2,iTimeStep);
        timeSeries(3,iTimeStep) = hij(1,3,iTimeStep);
        timeSeries(4,iTimeStep) = hij(2,1,iTimeStep);
        timeSeries(5,iTimeStep) = hij(2,2,iTimeStep);
        timeSeries(6,iTimeStep) = hij(2,3,iTimeStep);
        timeSeries(7,iTimeStep) = hij(3,1,iTimeStep);
        timeSeries(8,iTimeStep) = hij(3,2,iTimeStep);
        timeSeries(9,iTimeStep) = hij(3,3,iTimeStep);
    end
    
    figure(1)
    clf
    subplot(331)
    plot((1:timeSteps)./16384,timeSeries(1,:))
    xlabel('Seconds (assumes 16384 samples per second)')
    ylabel('Amplitude')
    grid on
    subplot(332)
    plot((1:timeSteps)./16384,timeSeries(2,:))
    title(['h_{ij} Timeseries  (' upper(simId) ')'])
    xlabel('Seconds (assumes 16384 samples per second)')
    ylabel('Amplitude')
    grid on
    subplot(333)
    plot((1:timeSteps)./16384,timeSeries(3,:))
    xlabel('Seconds (assumes 16384 samples per second)')
    ylabel('Amplitude')
    grid on
    subplot(334)
    plot((1:timeSteps)./16384,timeSeries(4,:))
    xlabel('Seconds (assumes 16384 samples per second)')
    ylabel('Amplitude')
    grid on
    subplot(335)
    plot((1:timeSteps)./16384,timeSeries(5,:))
    xlabel('Seconds (assumes 16384 samples per second)')
    ylabel('Amplitude')
    grid on
    subplot(336)
    plot((1:timeSteps)./16384,timeSeries(6,:))
    xlabel('Seconds (assumes 16384 samples per second)')
    ylabel('Amplitude')
    grid on
    subplot(337)
    plot((1:timeSteps)./16384,timeSeries(7,:))
    xlabel('Seconds (assumes 16384 samples per second)')
    ylabel('Amplitude')
    grid on
    subplot(338)
    plot((1:timeSteps)./16384,timeSeries(8,:))
    xlabel('Seconds (assumes 16384 samples per second)')
    ylabel('Amplitude')
    grid on
    subplot(339)
    plot((1:timeSteps)./16384,timeSeries(9,:))
    xlabel('Seconds (assumes 16384 samples per second)')
    ylabel('Amplitude')
    grid on
    shg
elseif length(varargin) == 2
    [row, col] = deal(varargin{1}, varargin{2});
    
    for iTimeStep = 1:timeSteps
        timeSeries(iTimeStep) = hij(row, col, iTimeStep);
    end
    
    figure(1)
    clf
    plot((1:timeSteps)./16384,timeSeries)
    title(['h_{' num2str(row)  num2str(col) '} Timeseries  (' upper(simId) ')'])
    xlabel('Seconds (assumes 16384 samples per second)')
    ylabel('Amplitude')
    grid on
    shg
else
    error('testmakeh: length(varargin) must be 0 or 2')
end    

return