📄 plotmri.m
字号:
max_val = get( DIF_max_radio, 'Value');
if max_val==0
set( DIF_min_radio, 'Enable', 'inactive');
else
set( DIF_min_radio, 'Enable', 'on');
end
UpdateDIFplot;
end
function DIFMinCallback( src, event )
min_val = get( DIF_min_radio, 'Value');
if min_val==0
set( DIF_max_radio, 'Enable', 'inactive');
else
set( DIF_max_radio, 'Enable', 'on');
end
UpdateDIFplot;
end
function DIFObsPksCallback( src, event )
set( DIF_obs_radio, 'Enable', 'inactive');
set( DIF_est_radio, 'Value', 0, 'Enable', 'on')
UpdateDIFplot;
end
function DIFEstPksCallback( src, event )
set( DIF_est_radio, 'Enable', 'inactive');
set( DIF_obs_radio, 'Value',0, 'Enable', 'on');
UpdateDIFplot;
end
function UpdateDIFplot(src, event)
alpha = orientations(o)+DIF_struct(1).theta;
alpha(find(alpha<0)) = alpha(find(alpha<0))+360; % make sure alpha is >=0
alpha(find(alpha>=360)) = alpha(find(alpha>=360))-360; % make sure alpha is <360
alpha_hat = orientations(o) + DIF_hat(o).theta_hat;
alpha_hat(find(alpha_hat<0)) = alpha_hat(find(alpha_hat<0))+360; % make sure alpha is >=0
alpha_hat(find(alpha_hat>=360)) = alpha_hat(find(alpha_hat>=360))-360; % make sure alpha is <360
axes(DIF_axes);
cla reset;
symbol_list = {'k.','k+'};
DIF_legend = {};
if get(DIF_obs_radio, 'Value')
if get(DIF_max_radio, 'Value') & get(DIF_min_radio, 'Value')
for count = 1:length(DIF_struct);
plot(DIF_axes,[alpha; alpha],[DIF_struct(count).X_max_obs(r,:,f) DIF_struct(count).X_min_obs(r,:,f)],symbol_list{count}); hold on;
DIF_legend{count} = ['Obs Max/Min - "' strrep(DIF_struct(count).terrain,'_',' ') '" Terrain'];
end
plot(DIF_axes,[alpha_hat alpha_hat],[DIF_hat(o).X_max_obs(r,:,f) DIF_hat(o).X_min_obs(r,:,f)],'bo'); hold on;
DIF_legend{count+1} = 'Obs Max/Min - Resampled';
elseif get(DIF_max_radio, 'Value')
for count = 1:length(DIF_struct);
plot(DIF_axes,alpha,DIF_struct(count).X_max_obs(r,:,f),symbol_list{count}); hold on;
DIF_legend{count} = ['Obs Max - "' strrep(DIF_struct(count).terrain,'_',' ') '" Terrain'];
end
plot(DIF_axes,alpha_hat,DIF_hat(o).X_max_obs(r,:,f),'bo'); hold on;
DIF_legend{count+1} = 'Obs Max - Resampled';
elseif get(DIF_min_radio, 'Value')
for count = 1:length(DIF_struct);
plot(DIF_axes,alpha,DIF_struct(count).X_min_obs(r,:,f),symbol_list{count}); hold on;
DIF_legend{count} = ['Obs Min - "' strrep(DIF_struct(count).terrain,'_',' ') '" Terrain'];
end
plot(DIF_axes,alpha_hat,DIF_hat(o).X_min_obs(r,:,f),'bo'); hold on;
DIF_legend{count+1} = 'Obs Min - Resampled';
end
elseif get(DIF_est_radio, 'Value')
if get(DIF_max_radio, 'Value') & get(DIF_min_radio, 'Value')
for count = 1:length(DIF_struct);
plot(DIF_axes,[alpha; alpha],[DIF_struct(count).X_max_est(r,:,f) DIF_struct(count).X_min_est(r,:,f)],symbol_list{count}); hold on;
DIF_legend{count} = ['Est Max/Min - "' strrep(DIF_struct(count).terrain,'_',' ') '" Terrain'];
end
plot(DIF_axes,[alpha_hat alpha_hat],[DIF_hat(o).X_max_est(r,:,f) DIF_hat(o).X_min_est(r,:,f)],'bo'); hold on;
DIF_legend{count+1} = 'Est Max/Min - Resampled';
elseif get(DIF_max_radio, 'Value')
for count = 1:length(DIF_struct);
plot(DIF_axes,alpha,DIF_struct(count).X_max_est(r,:,f),symbol_list{count}); hold on;
DIF_legend{count} = ['Est Max - "' strrep(DIF_struct(count).terrain,'_',' ') '" Terrain'];
end
plot(DIF_axes,alpha_hat,DIF_hat(o).X_max_est(r,:,f),'bo'); hold on;
DIF_legend{count+1} = 'Est Max - Resampled';
elseif get(DIF_min_radio, 'Value')
for count = 1:length(DIF_struct);
plot(DIF_axes,alpha,DIF_struct(count).X_min_est(r,:,f),symbol_list{count}); hold on;
DIF_legend{count} = ['Est Min - "' strrep(DIF_struct(count).terrain,'_',' ') '" Terrain'];
end
plot(DIF_axes,alpha_hat,DIF_hat(o).X_min_est(r,:,f),'bo'); hold on;
DIF_legend{count+1} = 'Est Min - Resampled';
end
end
v = axis;
plot([orientations(o) orientations(o)],[v(3) v(4)],'b--'); hold on;
DIF_legend{count+2} = 'Reference axis of building';
hold off;
xlabel('Wind Direction (degrees clockwise from North)');
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 ')']);
axis([0 360 v(3) v(4)]);
set(DIF_axes,'XTick',[0:45:360]);
legend(DIF_legend,'Location','Best');
end
function MRISelectCallback( src, event )
m = get( MRI_popup, 'Value');
UpdateMRIplot;
end
function MRIFrameSelectCallback( src, event )
f = get( MRI_frame_popup, 'Value');
set(DIF_frame_popup, 'Value',f);
UpdateMRIplot;
end
function MRIRespSelectCallback( src, event )
r = get( MRI_resp_popup, 'Value');
set(DIF_resp_popup, 'Value',r);
UpdateMRIplot;
end
function MRIMaxCallback( src, event )
max_val = get( MRI_max_radio, 'Value');
if max_val==0
set( MRI_min_radio, 'Enable', 'inactive');
else
set( MRI_min_radio, 'Enable', 'on');
end
UpdateMRIplot;
end
function MRIMinCallback( src, event )
min_val = get( MRI_min_radio, 'Value');
if min_val==0
set( MRI_max_radio, 'Enable', 'inactive');
else
set( MRI_max_radio, 'Enable', 'on');
end
UpdateMRIplot;
end
function MRIObsPksCallback( src, event )
obs_val = get( MRI_obs_radio, 'Value');
if obs_val==0
set( MRI_est_radio, 'Enable', 'inactive');
else
set( MRI_est_radio, 'Enable', 'on');
end
UpdateMRIplot;
end
function MRIEstPksCallback( src, event )
est_val = get( MRI_est_radio, 'Value');
if est_val==0
set( MRI_obs_radio, 'Enable', 'inactive');
else
set( MRI_obs_radio, 'Enable', 'on');
end
UpdateMRIplot;
end
function UpdateMRIplot(src, event)
axes(MRI_axes);
cla reset;
MRI_legend = {};
count = 1;
if get(MRI_obs_radio, 'Value')
if get(MRI_max_radio, 'Value') & get(MRI_min_radio, 'Value')
plot(MRI_axes,[orientations orientations],[squeeze(MRI_max_obs(m,f,:,r)); squeeze(MRI_min_obs(m,f,:,r))],'k.'); hold on;
MRI_legend{count} = 'Obs Max/Min'; count = count+1;
plot(MRI_axes,[0 360],[MRI_UKO_max_obs(m,f,r) MRI_UKO_max_obs(m,f,r)],'k--'); hold on;
MRI_legend{count} = 'Obs Max (unknown orientation)'; count = count+1;
plot(MRI_axes,[0 360],[MRI_UKO_min_obs(m,f,r) MRI_UKO_min_obs(m,f,r)],'k:'); hold on;
MRI_legend{count} = 'Obs Min (unknown orientation)'; count = count+1;
elseif get(MRI_max_radio, 'Value')
plot(MRI_axes,orientations,squeeze(MRI_max_obs(m,f,:,r)),'k.'); hold on;
MRI_legend{count} = 'Obs Max'; count = count+1;
plot(MRI_axes,[0 360],[MRI_UKO_max_obs(m,f,r) MRI_UKO_max_obs(m,f,r)],'k--'); hold on;
MRI_legend{count} = 'Obs Max (unknown orientation)'; count = count+1;
elseif get(MRI_min_radio, 'Value')
plot(MRI_axes,orientations,squeeze(MRI_min_obs(m,f,:,r)),'k.'); hold on;
MRI_legend{count} = 'Obs Min'; count = count+1;
plot(MRI_axes,[0 360],[MRI_UKO_min_obs(m,f,r) MRI_UKO_min_obs(m,f,r)],'k:'); hold on;
MRI_legend{count} = 'Obs Min (unknown orientation)'; count = count+1;
end
end
if get(MRI_est_radio, 'Value')
if get(MRI_max_radio, 'Value') & get(MRI_min_radio, 'Value')
plot(MRI_axes,[orientations orientations],[squeeze(MRI_max_est(m,f,:,r)); squeeze(MRI_min_est(m,f,:,r))],'b.'); hold on;
MRI_legend{count} = 'Est Max/Min'; count = count+1;
plot(MRI_axes,[0 360],[MRI_UKO_max_est(m,f,r) MRI_UKO_max_est(m,f,r)],'b--'); hold on;
MRI_legend{count} = 'Est Max (unknown orientation)'; count = count+1;
plot(MRI_axes,[0 360],[MRI_UKO_min_est(m,f,r) MRI_UKO_min_est(m,f,r)],'b:'); hold on;
MRI_legend{count} = 'Est Min (unknown orientation)'; count = count+1;
elseif get(MRI_max_radio, 'Value')
plot(MRI_axes,orientations,squeeze(MRI_max_est(m,f,:,r)),'b.'); hold on;
MRI_legend{count} = 'Est Max'; count = count+1;
plot(MRI_axes,[0 360],[MRI_UKO_max_est(m,f,r) MRI_UKO_max_est(m,f,r)],'b--'); hold on;
MRI_legend{count} = 'Est Max (unknown orientation)'; count = count+1;
elseif get(MRI_min_radio, 'Value')
plot(MRI_axes,orientations,squeeze(MRI_min_est(m,f,:,r)),'b.'); hold on;
MRI_legend{count} = 'Est Min'; count = count+1;
plot(MRI_axes,[0 360],[MRI_UKO_min_est(m,f,r) MRI_UKO_min_est(m,f,r)],'b:'); hold on;
MRI_legend{count} = 'Est Min (unknown orientation)'; count = count+1;
end
end
hold off;
xlabel('Building Orientation (degrees clockwise from North)');
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(MRI_axes,'XTick',[0:45:360]);
legend(MRI_legend,'Location','Best');
end
function DIFToggleCallback( src, event)
set( DIF_fig, 'Visible','on','Position',get(MRI_fig,'Position'))
set( MRI_fig, 'Visible', 'off')
set( MRI_DIF_toggle, 'Value', 0);
UpdateDIFplot;
end
function MRIToggleCallback( src, event)
set( MRI_fig, 'Visible','on','Position',get(DIF_fig,'Position'))
set( DIF_fig, 'Visible', 'off')
set( DIF_MRI_toggle, 'Value', 0);
UpdateMRIplot;
end
function ExitCallback( src, event )
close(DIF_fig);
close(MRI_fig);
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -