⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 plotdif.m

📁 低矮房屋风压系数、风荷载计算分析matlab程序
💻 M
📖 第 1 页 / 共 3 页
字号:
                plot(DIF_axes,[theta_d; theta_d],[X_max_obs_all(r,ind_d,f) X_min_obs_all(r,ind_d,f)],'kd'); hold on;
                DIF_legend{count} = 'Obs Max/Min D';  count = count+1;
            elseif get(max_radio, 'Value')
                plot(DIF_axes,theta_a,X_max_obs_all(r,ind_a,f),'k+'); hold on;
                DIF_legend{count} = 'Obs Max A';  count = count+1;
                plot(DIF_axes,theta_b,X_max_obs_all(r,ind_b,f),'ks'); hold on;
                DIF_legend{count} = 'Obs Max B';  count = count+1;
                plot(DIF_axes,theta_c,X_max_obs_all(r,ind_c,f),'kx'); hold on;
                DIF_legend{count} = 'Obs Max C';  count = count+1;
                plot(DIF_axes,theta_d,X_max_obs_all(r,ind_d,f),'kd'); hold on;
                DIF_legend{count} = 'Obs Max D';  count = count+1;
            elseif get(min_radio, 'Value')
                plot(DIF_axes,theta_a,X_min_obs_all(r,ind_a,f),'k+'); hold on;
                DIF_legend{count} = 'Obs Min A';  count = count+1;
                plot(DIF_axes,theta_b,X_min_obs_all(r,ind_b,f),'ks'); hold on;
                DIF_legend{count} = 'Obs Min B';  count = count+1;
                plot(DIF_axes,theta_c,X_min_obs_all(r,ind_c,f),'kx'); hold on;
                DIF_legend{count} = 'Obs Min C';  count = count+1;
                plot(DIF_axes,theta_d,X_min_obs_all(r,ind_d,f),'kd'); hold on;
                DIF_legend{count} = 'Obs Min D';  count = count+1;
            end
        end
        if get(interp_radio,'Value')
            if get(max_radio, 'Value') & get(min_radio, 'Value')
                plot(DIF_axes,[theta; theta],[X_max_obs(r,:,f) X_min_obs(r,:,f)],'k.'); hold on;
                DIF_legend{count} = 'Obs Max/Min (interp)'; count = count+1;
            elseif get(max_radio, 'Value')
                plot(DIF_axes,theta,X_max_obs(r,:,f),'k.'); hold on;
                DIF_legend{count} = 'Obs Max (interp)'; count = count+1;
            elseif get(min_radio, 'Value')
                plot(DIF_axes,theta,X_min_obs(r,:,f),'k.'); hold on;
                DIF_legend{count} = 'Obs Min (interp)'; count = count+1;
            end
        end
        if get(intbnd_radio,'Value')
            if get(max_radio, 'Value') & get(min_radio, 'Value')
                for i=1:n_m
                    ind_i = (i-1)*n_q+(1:n_q);
                    plot(DIF_axes,[theta; theta],[X_max_obs_bnd(r,ind_i,f) X_min_obs_bnd(r,ind_i,f)],['k' symbol_list{i}]); hold on;
                    DIF_legend{count} = ['Obs Max/Min' bnd_label{i}];  count = count+1;
                end
            elseif get(max_radio, 'Value')
                for i=1:n_m
                    ind_i = (i-1)*n_q+(1:n_q);
                    plot(DIF_axes,theta,X_max_obs_bnd(r,ind_i,f),['k' symbol_list{i}]); hold on;
                    DIF_legend{count} = ['Obs Max' bnd_label{i}];  count = count+1;
                end
            elseif get(min_radio, 'Value')
                for i=1:n_m
                    ind_i = (i-1)*n_q+(1:n_q);
                    plot(DIF_axes,theta,X_min_obs_bnd(r,ind_i,f),['k' symbol_list{i}]); hold on;
                    DIF_legend{count} = ['Obs Min' bnd_label{i}];  count = count+1;
                end
            end
        end
    end
    if get(est_radio, 'Value')
        if get(ave_radio,'Value')
            if get(max_radio, 'Value') & get(min_radio, 'Value')
                plot(DIF_axes,[theta; theta],[X_max_est(r,:,f) X_min_est(r,:,f)],'b.'); hold on;
                DIF_legend{count} = 'Est Max/Min'; count = count+1;
            elseif get(max_radio, 'Value')
                plot(DIF_axes,theta,X_max_est(r,:,f),'b.'); hold on;
                DIF_legend{count} = 'Est Max'; count = count+1;
            elseif get(min_radio, 'Value')
                plot(DIF_axes,theta,X_min_est(r,:,f),'b.'); hold on;
                DIF_legend{count} = 'Est Min'; count = count+1;
            end
        end
        if get(all_radio,'Value')
            if get(max_radio, 'Value') & get(min_radio, 'Value')
                plot(DIF_axes,[theta_a; theta_a],[X_max_est_all(r,ind_a,f) X_min_est_all(r,ind_a,f)],'b+'); hold on;
                DIF_legend{count} = 'Est Max/Min A';  count = count+1;
                plot(DIF_axes,[theta_b; theta_b],[X_max_est_all(r,ind_b,f) X_min_est_all(r,ind_b,f)],'bs'); hold on;
                DIF_legend{count} = 'Est Max/Min B';  count = count+1;
                plot(DIF_axes,[theta_c; theta_c],[X_max_est_all(r,ind_c,f) X_min_est_all(r,ind_c,f)],'bx'); hold on;
                DIF_legend{count} = 'Est Max/Min C';  count = count+1;
                plot(DIF_axes,[theta_d; theta_d],[X_max_est_all(r,ind_d,f) X_min_est_all(r,ind_d,f)],'bd'); hold on;
                DIF_legend{count} = 'Est Max/Min D';  count = count+1;
            elseif get(max_radio, 'Value')
                plot(DIF_axes,theta_a,X_max_est_all(r,ind_a,f),'b+'); hold on;
                DIF_legend{count} = 'Est Max A';  count = count+1;
                plot(DIF_axes,theta_b,X_max_est_all(r,ind_b,f),'bs'); hold on;
                DIF_legend{count} = 'Est Max B';  count = count+1;
                plot(DIF_axes,theta_c,X_max_est_all(r,ind_c,f),'bx'); hold on;
                DIF_legend{count} = 'Est Max C';  count = count+1;
                plot(DIF_axes,theta_d,X_max_est_all(r,ind_d,f),'bd'); hold on;
                DIF_legend{count} = 'Est Max D';  count = count+1;
            elseif get(min_radio, 'Value')
                plot(DIF_axes,theta_a,X_min_est_all(r,ind_a,f),'b+'); hold on;
                DIF_legend{count} = 'Est Min A';  count = count+1;
                plot(DIF_axes,theta_b,X_min_est_all(r,ind_b,f),'bs'); hold on;
                DIF_legend{count} = 'Est Min B';  count = count+1;
                plot(DIF_axes,theta_c,X_min_est_all(r,ind_c,f),'bx'); hold on;
                DIF_legend{count} = 'Est Min C';  count = count+1;
                plot(DIF_axes,theta_d,X_min_est_all(r,ind_d,f),'bd'); hold on;
                DIF_legend{count} = 'Est Min D';  count = count+1;
            end
        end
        if get(interp_radio,'Value')
            if get(max_radio, 'Value') & get(min_radio, 'Value')
                plot(DIF_axes,[theta; theta],[X_max_est(r,:,f) X_min_est(r,:,f)],'b.'); hold on;
                DIF_legend{count} = 'Est Max/Min (interp)'; count = count+1;
            elseif get(max_radio, 'Value')
                plot(DIF_axes,theta,X_max_est(r,:,f),'b.'); hold on;
                DIF_legend{count} = 'Est Max (interp)'; count = count+1;
            elseif get(min_radio, 'Value')
                plot(DIF_axes,theta,X_min_est(r,:,f),'b.'); hold on;
                DIF_legend{count} = 'Est Min (interp)'; count = count+1;
            end
        end
        if get(intbnd_radio,'Value')
            if get(max_radio, 'Value') & get(min_radio, 'Value')
                for i=1:n_m
                    ind_i = (i-1)*n_q+(1:n_q);
                    plot(DIF_axes,[theta; theta],[X_max_est_bnd(r,ind_i,f) X_min_est_bnd(r,ind_i,f)],['b' symbol_list{i}]); hold on;
                    DIF_legend{count} = ['Est Max/Min' bnd_label{i}];  count = count+1;
                end
            elseif get(max_radio, 'Value')
                for i=1:n_m
                    ind_i = (i-1)*n_q+(1:n_q);
                    plot(DIF_axes,theta,X_max_est_bnd(r,ind_i,f),['b' symbol_list{i}]); hold on;
                    DIF_legend{count} = ['Est Max' bnd_label{i}];  count = count+1;
                end
            elseif get(min_radio, 'Value')
                for i=1:n_m
                    ind_i = (i-1)*n_q+(1:n_q);
                    plot(DIF_axes,theta,X_min_est_bnd(r,ind_i,f),['b' symbol_list{i}]); hold on;
                    DIF_legend{count} = ['Est Min' bnd_label{i}];  count = count+1;
                end
            end
        end
    end
    hold off;
    xlabel('Wind Direction (degrees)');
    ylabel([resp_names{r} ' (' resp_units{r} ')']);
    title(['Peak values of Response ' num2str(r) ' (' resp_names{r} ') for Frame ' ...
        num2str(f) ' (y = ' num2str(frame_loc(f)) ' ' length_units ')']);
    v = axis;
    axis([0 360 v(3) v(4)]);
    set(DIF_axes,'XTick',[0:45:360]);
    if get(legend_ckbox, 'Value')
        legend(DIF_legend,'Location','EastOutside');
    end
end

function UpdateLoadPlot(src,event)
    axes(load_axes);
    cla reset;
    if strcmp(get(loadsym_popup,'Enable'),'on')
        if get(loadsym_popup, 'Value')==1
            if get(loadmax_radio,'Value')==1
                frame_vector_plot( load_max(:,r, q, f), attach_pts, d0(1), d0(3), d0(4), 2, 'k' );
                xlabel(['x-coordinate (' length_units ')']);
                ylabel(['y-coordinate (' length_units ')']);
                title({['Wind Direction = ' num2str(theta(q)) ' degrees; Averaged loading'],[],...
                    ['Loading producing maximum value (' num2str(X_max_obs(r,q,f)) ' ' resp_units{r} ...
                    ') of Response ' num2str(r) ' (' resp_names{r} ...
                    ') in Frame ' num2str(f) ' (y = ' num2str(frame_loc(f)) ' ' length_units ')']});
                if get( loadcirc_ckbox, 'Value')
                    axes(DIF_axes); hold on;
                    load_circle = plot( theta(q), X_max_obs(r,q,f),'ro'); hold off;
                end
             else
                frame_vector_plot( load_min(:,r, q, f), attach_pts, d0(1), d0(3), d0(4), 2, 'k' );
                xlabel(['x-coordinate (' length_units ')']);
                ylabel(['y-coordinate (' length_units ')']);
                title({['Wind Direction = ' num2str(theta(q)) ' degrees; Averaged loading'],[],...
                    ['Loading producing minimum value (' num2str(X_min_obs(r,q,f)) ' ' resp_units{r} ...
                    ') of Response ' num2str(r) ' (' resp_names{r} ...
                    ') in Frame ' num2str(f) ' (y = ' num2str(frame_loc(f)) ' ' length_units ')']});
                if get( loadcirc_ckbox, 'Value')
                    axes(DIF_axes); hold on;
                    load_circle = plot( theta(q), X_min_obs(r,q,f),'ro'); hold off;
                end
            end
        else % if not averaged loading
            ind = find(theta_all==theta(q));
            qa_ind = ind( get(loadsym_popup, 'Value')-1);
            if qa_ind<=n_qa/4
                wdir_label = 'Wind Direction A';
            elseif qa_ind<=n_qa/2
                wdir_label = 'Wind Direction B';
            elseif qa_ind<=n_qa*3/4
                wdir_label = 'Wind Direction C';
            else
                wdir_label = 'Wind Direction D';
            end
            if get(loadmax_radio,'Value')==1
                frame_vector_plot( load_max_all(:,r, qa_ind, f), attach_pts, d0(1), d0(3), d0(4), 2, 'k' );
                xlabel(['x-coordinate (' length_units ')']);
                ylabel(['y-coordinate (' length_units ')']);
                title({[wdir_label ' = ' num2str(theta_all(qa_ind)) ' degrees'],[],...
                    ['Loading producing maximum value (' num2str(X_max_obs_all(r,qa_ind,f)) ' ' resp_units{r} ...
                    ') of Response ' num2str(r) ' (' resp_names{r} ...
                    ') in Frame ' num2str(f) ' (y = ' num2str(frame_loc(f)) ' ' length_units ')']});
                if get( loadcirc_ckbox, 'Value')
                    axes(DIF_axes); hold on;
                    load_circle = plot( theta_all(qa_ind), X_max_obs_all(r,qa_ind,f),'ro'); hold off;
                end
            else
                frame_vector_plot( load_min_all(:,r, qa_ind, f), attach_pts, d0(1), d0(3), d0(4), 2, 'k' );
                xlabel(['x-coordinate (' length_units ')']);
                ylabel(['y-coordinate (' length_units ')']);
                title({[wdir_label ' = ' num2str(theta_all(qa_ind)) ' degrees'],[],...
                    ['Loading producing minimum value (' num2str(X_min_obs_all(r,qa_ind,f)) ' ' resp_units{r} ...
                    ') of Response ' num2str(r) ' (' resp_names{r} ...
                    ') in Frame ' num2str(f) ' (y = ' num2str(frame_loc(f)) ' ' length_units ')']});
                if get( loadcirc_ckbox, 'Value')
                    axes(DIF_axes); hold on;
                    load_circle = plot( theta_all(qa_ind), X_min_obs_all(r,qa_ind,f),'ro'); hold off;
                end
            end
        end
    elseif strcmp(get(loadinterp_popup,'Enable'),'on') % if interpolated loading
        if get(loadinterp_popup, 'Value')==1
            if get(loadmax_radio,'Value')==1
                frame_vector_plot( load_max(:,r, q, f), attach_pts, d0(1), d0(3), d0(4), 2, 'k' );
                xlabel(['x-coordinate (' length_units ')']);
                ylabel(['y-coordinate (' length_units ')']);
                title({['Wind Direction = ' num2str(theta(q)) ' degrees ' loadinterp_label{1}],[],...
                    ['Loading producing maximum value (' num2str(X_max_obs(r,q,f)) ' ' resp_units{r} ...
                    ') of Response ' num2str(r) ' (' resp_names{r} ...
                    ') in Frame ' num2str(f) ' (y = ' num2str(frame_loc(f)) ' ' length_units ')']});
                if get( loadcirc_ckbox, 'Value')
                    axes(DIF_axes); hold on;
                    load_circle = plot( theta(q), X_max_obs(r,q,f),'ro'); hold off;
                end
            else
                frame_vector_plot( load_min(:,r, q, f), attach_pts, d0(1), d0(3), d0(4), 2, 'k' );
                xlabel(['x-coordinate (' length_units ')']);
                ylabel(['y-coordinate (' length_units ')']);
                title({['Wind Direction = ' num2str(theta(q)) ' degrees ' loadinterp_label{1}],[],...
                    ['Loading producing minimum value (' num2str(X_min_obs(r,q,f)) ' ' resp_units{r} ...
                    ') of Response ' num2str(r) ' (' resp_names{r} ...
                    ') in Frame ' num2str(f) ' (y = ' num2str(frame_loc(f)) ' ' length_units ')']});
                if get( loadcirc_ckbox, 'Value')
                    axes(DIF_axes); hold on;
                    load_circle = plot( theta(q), X_min_obs(r,q,f),'ro'); hold off;
                end
            end
        else % if not averaged loading
            m = get(loadinterp_popup, 'Value')-1; % model number
            ind = (m-1)*n_q+q;
            if get(loadmax_radio,'Value')==1
                frame_vector_plot( load_max_bnd(:,r, ind, f), attach_pts, d0(1), d0(3), d0(4), 2, 'k' );
                xlabel(['x-coordinate (' length_units ')']);
                ylabel(['y-coordinate (' length_units ')']);
                title({['Wind Direction = ' num2str(theta(q)) ' degrees; ' loadinterp_label{m+1}],[],...
                    ['Loading producing maximum value (' num2str(X_max_obs_bnd(r,ind,f)) ' ' resp_units{r} ...
                    ') of Response ' num2str(r) ' (' resp_names{r} ...
                    ') in Frame ' num2str(f) ' (y = ' num2str(frame_loc(f)) ' ' length_units ')']});
                if get( loadcirc_ckbox, 'Value')
                    axes(DIF_axes); hold on;
                    load_circle = plot( theta(q), X_max_obs_bnd(r,ind,f),'ro'); hold off;
                end
            else
                frame_vector_plot( load_min_bnd(:,r, ind, f), attach_pts, d0(1), d0(3), d0(4), 2, 'k' );
                xlabel(['x-coordinate (' length_units ')']);
                ylabel(['y-coordinate (' length_units ')']);
                title({['Wind Direction = ' num2str(theta(q)) ' degrees; ' loadinterp_label{m+1}],[],...
                    ['Loading producing minimum value (' num2str(X_min_obs_bnd(r,ind,f)) ' ' resp_units{r} ...
                    ') of Response ' num2str(r) ' (' resp_names{r} ...
                    ') in Frame ' num2str(f) ' (y = ' num2str(frame_loc(f)) ' ' length_units ')']});
                if get( loadcirc_ckbox, 'Value')
                    axes(DIF_axes); hold on;
                    load_circle = plot( theta(q), X_min_obs_bnd(r,ind,f),'ro'); hold off;
                end
            end
        end
        
        
        
    end
end




end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -