
%
%  update_power_spectal_density_alt.m  ver 1.2  by Tom Irvine
%

function[cell_array]=update_power_spectral_density_alt()

            navmat_spec=   [ 20 	      0.01 
                            80 	      0.04 
                            350 	      0.04 
                            2000 	     0.007 ];
            output_name='navmat_spec';
            assignin('base', output_name, navmat_spec);

              smc_s_016=[20           0.0053         
                        150         0.04
                        800         0.04
                        2000       0.0064];
            output_name='smc_s_016';
            assignin('base', output_name, smc_s_016);


            vars = evalin('base', 'whos');
            cell_array = cell(size(vars));
            for i=1:length(vars)
                cell_array{i} ='999';
                if(contains(vars(i).name,'myHandle') || ...
                   contains(vars(i).name,'vname_list') || ...
                   contains(vars(i).name,'Dirlik_N') || ...
                   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,'modal_density') || ...
                   contains(vars(i).name,'vname_list') || ...
                   contains(vars(i).name,'vafb_1p') || ...
                   strcmp(vars(i).name,'velocity_spectrum') || ...
                   strcmp(vars(i).name,'accel_ps') || ...
                   strcmp(vars(i).name,'accel_spectrum') || ...
                   strcmp(vars(i).name,'pink_spectrum') || ...
                   strcmp(vars(i).name,'force_pink_noise_rms') || ...
                   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,'ans') || ...
                   strcmp(vars(i).name,'external_power_dB') || ...
                   strcmp(vars(i).name,'m1540_spl') || ...
                   strcmp(vars(i).name,'net_noise_reduction') || ...
                   strcmp(vars(i).name,'acoustic_cavity_spl') || ...
                   strcmp(vars(i).name,'avionics_module_liftoff_spl') || ...
                   strcmp(vars(i).name,'p31_liftoff_spl') || ...
                   strcmp(vars(i).name,'p32_liftoff_spl') || ...
                   strcmp(vars(i).name,'full_accelerance_frf') || ...
                   strcmp(vars(i).name,'rel_disp_node_1') || ...
                   strcmp(vars(i).name,'nn_max') || ...
                   strcmp(vars(i).name,'nn_mean') || ...          
                   contains(vars(i).name,'unsigned_') || ...
                   contains(vars(i).name,'amp_cycles') || ...
                   contains(vars(i).name,'range_cycles') || ...
                   contains(vars(i).name,'amp_mean_cycles') || ...
                   contains(vars(i).name,'range_cycles_max_min')|| ...
                   strcmp(vars(i).name,'two_dof_mass') ||...
                   strcmp(vars(i).name,'point_mass_matrix') ||...
                   strcmp(vars(i).name,'dB_difference') ||...
                   contains(vars(i).name,'Hanning') ||...
                   contains(vars(i).name,'crash') ||...
                   contains(vars(i).name,'_trans_') ||...
                   contains(vars(i).name,'mspan_') ||...
                   contains(vars(i).name,'_trans') ||...
                   strcmp(vars(i).name,'sz'))          

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

                    try
                        mint2=min(ggg(:,2));
                        maxt2=max(ggg(:,2));

                        % fprintf(' %s  %8.4g  %8.4g  %d  \n',vars(i).name,mint2,maxt2,sz(2))
    
                        if(sz(2)==2 && mint2>=0 && maxt2<=1e+06)
                            cell_array{i} = vars(i).name;
                        else
                            cell_array{i} ='999';
                        end
                    catch
                        cell_array{i} ='999';
                    end    
                end    
            end
            for i=length(vars):-1:1
                if(contains(cell_array{i},'999'))
                    cell_array(i,:)=[];
                end
            end         