
%
%  update_time_history.m  ver 1.2  by Tom Irvine
%

function[cell_array]=update_time_history()

            vars = evalin('base', 'whos');
            cell_array = cell(size(vars));
            for i=1:length(vars)
                cell_array{i} ='999';
                vars(i).name;
                if(contains(vars(i).name,'myHandle') || ...
                   contains(vars(i).name,'HM_acc_force_') || ...   
                   contains(vars(i).name,'H_acc_force_') || ... 
                   contains(vars(i).name,'beam_trans_') || ...
                   contains(vars(i).name,'_psd_node_') || ...
                   contains(vars(i).name,'_trans_node_') || ...
                   contains(vars(i).name,'_trans_complex_node_') || ...
                   contains(vars(i).name,'vname_list') || ...
                   contains(vars(i).name,'Dirlik_N') || ...
                   contains(vars(i).name,'radiation resistance') || ...
                   contains(vars(i).name,'radiation efficiency') || ...
                    contains(vars(i).name,'transmission_loss') || ...
                    contains(vars(i).name,'cylindrical_shell_modal_overlap') || ...
                    contains(vars(i).name,'equipment_shelf_modal_overlap') || ...
                    contains(vars(i).name,'external_to_cylinder_power') || ...
                    contains(vars(i).name,'cylinder_to_cavity_power') || ...
                    contains(vars(i).name,'cylinder_to_shelf_power') || ...
                    contains(vars(i).name,'cavity_to_shelf_power') || ...
                    contains(vars(i).name,'shelf_to_cavity_power') || ...
                    contains(vars(i).name,'cylindrical_shell_modal_dens') || ...
                    contains(vars(i).name,'acoustic_cavity_modal_dens') || ...
                    contains(vars(i).name,'equipment_shelf_modal_dens') || ...
                    contains(vars(i).name,'cylindrical_shell_rad_eff') || ...
                    contains(vars(i).name,'equipment_shelf_rad_eff') || ...
                    contains(vars(i).name,'cylindrical_shell_dlf') || ...
                    contains(vars(i).name,'acoustic_cavity_dlf') || ...
                    contains(vars(i).name,'equipment_shelf_dlf') || ...
                    contains(vars(i).name,'cylinder_to_cavity_clf') || ...
                    contains(vars(i).name,'cylinder_to_shelf_clf') || ...
                    contains(vars(i).name,'cavity_to_shelf_clf') || ...
                    contains(vars(i).name,'shelf_to_cavity_clf') || ...
                    contains(vars(i).name,'cylindrical_shell_energy') || ...
                    contains(vars(i).name,'acoustic_cavity_energy') || ...
                    contains(vars(i).name,'equipment_shelf_energy') || ...
                    contains(vars(i).name,'cylindrical_shell_vel_psd') || ...
                    contains(vars(i).name,'equipment_shelf_vel_psd') || ...
                    contains(vars(i).name,'cylindrical_shell_accel_psd') || ...
                    contains(vars(i).name,'equipment_shelf_accel_psd') || ...
                    contains(vars(i).name,'vname_list') || ...
                    contains(vars(i).name,'vafb_1p') || ...
                    contains(vars(i).name,'velocity_spectrum') || ...
                    contains(vars(i).name,'accel_ps') || ...
                    contains(vars(i).name,'accel_spectrum') || ...
                    contains(vars(i).name,'pink_spectrum') || ...
                    contains(vars(i).name,'force_pink_noise_rms') || ...  
                    contains(vars(i).name,'HM_disp_force') || ...  
                    contains(vars(i).name,'HM_vel_force') || ...  
                    contains(vars(i).name,'H_disp_force') || ...  
                    contains(vars(i).name,'H_vel_force') || ...
                   strcmp(vars(i).name,'ans') || ... 
                   strcmp(vars(i).name,'cepstrum') || ... 
                   strcmp(vars(i).name,'Ha_11') || ... 
                   strcmp(vars(i).name,'Ha_12') || ... 
                   strcmp(vars(i).name,'Ha_21') || ... 
                   strcmp(vars(i).name,'Ha_22') || ... 
                   strcmp(vars(i).name,'Hd_11') || ... 
                   strcmp(vars(i).name,'Hd_12') || ... 
                   strcmp(vars(i).name,'Hd_21') || ... 
                   strcmp(vars(i).name,'Hd_22') || ...
                   strcmp(vars(i).name,'Hv_11') || ... 
                   strcmp(vars(i).name,'Hv_12') || ... 
                   strcmp(vars(i).name,'Hv_21') || ... 
                   strcmp(vars(i).name,'Hv_22') || ...       
                   strcmp(vars(i).name,'liftoff_ground_spl') || ...  
                   strcmp(vars(i).name,'two_dof_mass') || ...  
                   strcmp(vars(i).name,'two_dof_stiffness') || ...   
                   strcmp(vars(i).name,'navmat_spec') || ...  
                   strcmp(vars(i).name,'power_trans') || ...  
                   strcmp(vars(i).name,'navmat_spec_6dB') || ...  
                   strcmp(vars(i).name,'PLF_psd') || ...
                   strcmp(vars(i).name,'PLF_spl') || ... 
                   strcmp(vars(i).name,'Harris_2p') || ... 
                   strcmp(vars(i).name,'vafb_1p') || ...  
                   strcmp(vars(i).name,'mode1') || ...
                   strcmp(vars(i).name,'mode_1') || ...
                   strcmp(vars(i).name,'mode_2') || ...
                   strcmp(vars(i).name,'mode_3') || ...              
                   strcmp(vars(i).name,'mode_4') || ...
                   strcmp(vars(i).name,'mode_5') || ... 
                   strcmp(vars(i).name,'mode_6') || ...           
                   strcmp(vars(i).name,'two_dof_ModeShapes') || ...
                   strcmp(vars(i).name,'stress_th') || ...
                   strcmp(vars(i).name,'sine_sweep_transmissibility') || ...
                   contains(vars(i).name,'amp_cycles') || ...
                   contains(vars(i).name,'range_cycles') || ...
                   contains(vars(i).name,'amp_mean_cycles') || ...
                   contains(vars(i).name,'smc_s_016') || ...
                   contains(vars(i).name,'crash_srs') ||...
                   contains(vars(i).name,'H1_complex') || ...
                   contains(vars(i).name,'H2_complex') ||...
                   contains(vars(i).name,'range_cycles_max_min'))          

                   cell_array{i} ='999';
                else    
                    try
               
                        TTT=evalin('base',vars(i).name);
                        sz=size(TTT);

                        dTT=diff(TTT(:,1));

                        if(sz(1)>=3 && sz(2)==2 && (max(dTT)<2*mean(dTT)) && mean(dTT)<200)
                            cell_array{i} = vars(i).name;
                        else
                            cell_array{i} ='999';
                        end    

                    catch
                        % disp('evalin failed');
                    end
                end    
            end

            try
                for i=length(vars):-1:1
                    if(contains(cell_array{i},'999'))
                        cell_array(i,:)=[];
                    end
                end    
            catch
                disp(' 999 failure');
            end