
%
%  update_stiffness_array_guyan.m  ver 1.1  by Tom Irvine
%

function[cell_array]=update_stiffness_array_guyan()

            vars = evalin('base', 'whos');
            cell_array = cell(size(vars));
            for i=1:length(vars)
                cell_array{i} ='999';
                vars(i).name=strtrim(vars(i).name);
                if(contains(vars(i).name,'myHandle') || ...
                   contains(vars(i).name,'vname_list') || ...
                   contains(vars(i).name,'Dirlik_N') || ...
                   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,'stress_th') || ...
                   strcmp(vars(i).name,'ans') || ...
                   strcmp(vars(i).name,'two_dof_ModeShapes') || ...
                   strcmp(vars(i).name,'two_dof_mass') || ...
                   strcmp(vars(i).name,'bending_modeshapes') || ...
                   strcmp(vars(i).name,'bending_mass') || ...
                   strcmp(vars(i).name,'reduced_mass') || ...
                   strcmp(vars(i).name,'reordered_mass') || ...
                   strcmp(vars(i).name,'reduced_modes') || ...
                   strcmp(vars(i).name,'reduced_stiffness') || ...
                   strcmp(vars(i).name,'reordered_stiffness') || ...
                   strcmp(vars(i).name,'M11') || ...
                   strcmp(vars(i).name,'M21') || ...
                   strcmp(vars(i).name,'M22') || ...
                   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,'range_cycles_max_min'))          

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


                        if(sz(1)==sz(2) && sz(1)>=2)
                            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