Change subaxis to subplot

This commit is contained in:
2019-10-14 16:45:24 +02:00
parent 075bf199da
commit cdbd62b3ee
9 changed files with 45 additions and 45 deletions

View File

@@ -11,7 +11,7 @@ load('./mat/config.mat', 'save_fig', 'freqs');
%% New Plant damped
figure;
% Amplitude
ax1 = subaxis(2,1,1);
ax1 = subplot(2,1,1);
hold on;
plot(freqs, abs(squeeze(freqresp(G_light_vc.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), '-', 'DisplayName', 'Light VC');
plot(freqs, abs(squeeze(freqresp(G_light_pz.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), '-', 'DisplayName', 'Light PZ');
@@ -24,7 +24,7 @@ set(gca, 'XTickLabel',[]);
legend('Location', 'southwest');
hold off;
% Phase
ax2 = subaxis(2,1,2);
ax2 = subplot(2,1,2);
hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_vc.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), '-');
plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_pz.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), '-');

View File

@@ -11,7 +11,7 @@ load('./mat/config.mat', 'save_fig', 'freqs');
%% Plot the Loop gain for Translations - Light VC
figure;
% Amplitude
ax1 = subaxis(2,1,1);
ax1 = subplot(2,1,1);
hold on;
plot(freqs, abs(squeeze(freqresp(K_light_vc_iff(1, 1)*G_iff_light_vc.G_cart(1, 1), freqs, 'Hz'))), 'DisplayName', 'x');
plot(freqs, abs(squeeze(freqresp(K_light_vc_iff(2, 2)*G_iff_light_vc.G_cart(2, 2), freqs, 'Hz'))), 'DisplayName', 'y');
@@ -21,7 +21,7 @@ set(gca, 'XTickLabel',[]);
ylabel('Amplitude [m/N]');
hold off;
% Phase
ax2 = subaxis(2,1,2);
ax2 = subplot(2,1,2);
hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_vc_iff(1, 1)*G_iff_light_vc.G_cart(1, 1), freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_vc_iff(2, 2)*G_iff_light_vc.G_cart(2, 2), freqs, 'Hz'))));
@@ -39,7 +39,7 @@ if save_fig; exportFig('loop_gain_fb_iff_light_vc_trans', 'normal-normal', struc
%% Plot the Loop gain for Rotations - Light VC
figure;
% Amplitude
ax1 = subaxis(2,1,1);
ax1 = subplot(2,1,1);
hold on;
plot(freqs, abs(squeeze(freqresp(K_light_vc_iff(4, 4)*G_iff_light_vc.G_cart(4, 4), freqs, 'Hz'))), 'DisplayName', 'Rx');
plot(freqs, abs(squeeze(freqresp(K_light_vc_iff(5, 5)*G_iff_light_vc.G_cart(5, 5), freqs, 'Hz'))), 'DisplayName', 'Ry');
@@ -48,7 +48,7 @@ set(gca, 'XTickLabel',[]);
ylabel('Amplitude [m/N]');
hold off;
% Phase
ax2 = subaxis(2,1,2);
ax2 = subplot(2,1,2);
hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_vc_iff(4, 4)*G_iff_light_vc.G_cart(4, 4), freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_vc_iff(5, 5)*G_iff_light_vc.G_cart(5, 5), freqs, 'Hz'))));
@@ -65,7 +65,7 @@ if save_fig; exportFig('loop_gain_fb_iff_light_vc_rot', 'normal-normal', struct(
%% Plot the Loop gain for Translations - Light PZ
figure;
% Amplitude
ax1 = subaxis(2,1,1);
ax1 = subplot(2,1,1);
hold on;
plot(freqs, abs(squeeze(freqresp(K_light_pz_iff(1, 1)*G_iff_light_pz.G_cart(1, 1), freqs, 'Hz'))), 'DisplayName', 'x');
plot(freqs, abs(squeeze(freqresp(K_light_pz_iff(2, 2)*G_iff_light_pz.G_cart(2, 2), freqs, 'Hz'))), 'DisplayName', 'y');
@@ -75,7 +75,7 @@ set(gca, 'XTickLabel',[]);
ylabel('Amplitude [m/N]');
hold off;
% Phase
ax2 = subaxis(2,1,2);
ax2 = subplot(2,1,2);
hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_pz_iff(1, 1)*G_iff_light_pz.G_cart(1, 1), freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_pz_iff(2, 2)*G_iff_light_pz.G_cart(2, 2), freqs, 'Hz'))));
@@ -93,7 +93,7 @@ if save_fig; exportFig('loop_gain_fb_iff_light_pz_trans', 'normal-normal', struc
%% Plot the Loop gain for Rotations - Light PZ
figure;
% Amplitude
ax1 = subaxis(2,1,1);
ax1 = subplot(2,1,1);
hold on;
plot(freqs, abs(squeeze(freqresp(K_light_pz_iff(4, 4)*G_iff_light_pz.G_cart(4, 4), freqs, 'Hz'))), 'DisplayName', 'Rx');
plot(freqs, abs(squeeze(freqresp(K_light_pz_iff(5, 5)*G_iff_light_pz.G_cart(5, 5), freqs, 'Hz'))), 'DisplayName', 'Ry');
@@ -102,7 +102,7 @@ set(gca, 'XTickLabel',[]);
ylabel('Amplitude [m/N]');
hold off;
% Phase
ax2 = subaxis(2,1,2);
ax2 = subplot(2,1,2);
hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_pz_iff(4, 4)*G_iff_light_pz.G_cart(4, 4), freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(K_light_pz_iff(5, 5)*G_iff_light_pz.G_cart(5, 5), freqs, 'Hz'))));

View File

@@ -10,7 +10,7 @@ load('./mat/config.mat', 'save_fig', 'freqs');
%% Plant
figure;
% Amplitude
ax1 = subaxis(2,1,1);
ax1 = subplot(2,1,1);
hold on;
plot(freqs, abs(squeeze(freqresp(G_light_vc.G_cart('Dx', 'Fnx'), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(G_light_pz.G_cart('Dx', 'Fnx'), freqs, 'Hz'))));
@@ -23,7 +23,7 @@ ylabel('Amplitude [m/N]');
hold off;
% Phase
ax2 = subaxis(2,1,2);
ax2 = subplot(2,1,2);
hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_vc.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), 'DisplayName', 'VC - Light');
plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_pz.G_cart('Dx', 'Fnx'), freqs, 'Hz'))), 'DisplayName', 'PZ - Light');
@@ -44,7 +44,7 @@ if save_fig; exportFig('comp_models_plant_x_x', 'normal-normal', struct('path',
%%
figure;
% Amplitude
ax1 = subaxis(2,1,1);
ax1 = subplot(2,1,1);
hold on;
plot(freqs, abs(squeeze(freqresp(G_light_vc.G_cart('Dz', 'Fnz'), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(G_light_pz.G_cart('Dz', 'Fnz'), freqs, 'Hz'))));
@@ -57,7 +57,7 @@ ylabel('Amplitude [m/N]');
hold off;
% Phase
ax2 = subaxis(2,1,2);
ax2 = subplot(2,1,2);
hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_vc.G_cart('Dz', 'Fnz'), freqs, 'Hz'))), 'DisplayName', 'VC - Light');
plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_pz.G_cart('Dz', 'Fnz'), freqs, 'Hz'))), 'DisplayName', 'PZ - Light');
@@ -80,7 +80,7 @@ figure;
for i_input = 1:3
for i_output = 1:3
subaxis(3,3,3*(i_input-1)+i_output);
subplot(3,3,3*(i_input-1)+i_output);
hold on;
plot(freqs, abs(squeeze(freqresp(G_light_vc.G_cart(i_output, i_input), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(G_light_pz.G_cart(i_output, i_input), freqs, 'Hz'))));

View File

@@ -7,10 +7,10 @@ load('./mat/G.mat', 'G_light_vc', 'G_light_pz', 'G_heavy_vc', 'G_heavy_pz');
%% Load Configuration file
load('./mat/config.mat', 'save_fig', 'freqs');
%%
%%
figure;
% Amplitude
ax1 = subaxis(2,1,1);
ax1 = subplot(2,1,1);
hold on;
plot(freqs, abs(squeeze(freqresp(G_light_vc.G_iff('Fm1', 'F1'), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(G_light_pz.G_iff('Fm1', 'F1'), freqs, 'Hz'))));
@@ -23,7 +23,7 @@ ylabel('Amplitude [m/N]');
hold off;
% Phase
ax2 = subaxis(2,1,2);
ax2 = subplot(2,1,2);
hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_vc.G_iff('Fm1', 'F1'), freqs, 'Hz'))), 'DisplayName', 'VC - Light');
plot(freqs, 180/pi*angle(squeeze(freqresp(G_light_pz.G_iff('Fm1', 'F1'), freqs, 'Hz'))), 'DisplayName', 'PZ - Light');

View File

@@ -23,7 +23,7 @@ dir = 'y';
figure;
% Amplitude
ax1 = subaxis(2,1,1);
ax1 = subplot(2,1,1);
hold on;
plot(freqs, abs(squeeze(freqresp(G_ms_flexible(['Dg' dir], ['Fg' dir]), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(G_ms_ty_rigid(['Dg' dir], ['Fg' dir]), freqs, 'Hz'))), '--');
@@ -33,7 +33,7 @@ set(gca, 'XTickLabel',[]);
legend({'Flexible', 'Ty - Rigid'});
hold off;
% Phase
ax2 = subaxis(2,1,2);
ax2 = subplot(2,1,2);
hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms_flexible(['Dg' dir], ['Fg' dir]), freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms_ty_rigid(['Dg' dir], ['Fg' dir]), freqs, 'Hz'))), '--');
@@ -49,7 +49,7 @@ dir = 'y';
figure;
% Amplitude
ax1 = subaxis(2,1,1);
ax1 = subplot(2,1,1);
hold on;
plot(freqs, abs(squeeze(freqresp(G_ms_flexible(['Dm' dir], ['Fm' dir]), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(G_ms_ty_rigid(['Dm' dir], ['Fm' dir]), freqs, 'Hz'))), '--');
@@ -59,7 +59,7 @@ set(gca, 'XTickLabel',[]);
legend({'Flexible', 'Ty - Rigid'});
hold off;
% Phase
ax2 = subaxis(2,1,2);
ax2 = subplot(2,1,2);
hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms_flexible(['Dm' dir], ['Fm' dir]), freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms_ty_rigid(['Dm' dir], ['Fm' dir]), freqs, 'Hz'))), '--');
@@ -75,7 +75,7 @@ dir = 'z';
figure;
% Amplitude
ax1 = subaxis(2,1,1);
ax1 = subplot(2,1,1);
hold on;
plot(freqs, abs(squeeze(freqresp(G_ms_flexible(['Dg' dir], ['Fm' dir]), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(G_ms_ty_rigid(['Dg' dir], ['Fm' dir]), freqs, 'Hz'))), '--');
@@ -86,7 +86,7 @@ set(gca, 'XTickLabel',[]);
legend({'Flexible', 'Ty - Rigid'});
hold off;
% Phase
ax2 = subaxis(2,1,2);
ax2 = subplot(2,1,2);
hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms_flexible(['Dg' dir], ['Fm' dir]), freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms_ty_rigid(['Dg' dir], ['Fm' dir]), freqs, 'Hz'))), '--');

View File

@@ -22,7 +22,7 @@ meas_sys = getDynamicTFs(m_object, 'marble', 'hexa', {{'tx', 'tx'},{'ty', 'ty'},
for dir = 'xyz'
figure;
% Amplitude
ax1 = subaxis(2,1,1);
ax1 = subplot(2,1,1);
hold on;
plot(freqs, abs(squeeze(freqresp(G_ms(['Dg' dir], ['Fg' dir]), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(meas_sys(['Dm' dir], ['Fm' dir]), freqs, 'Hz'))), '.');
@@ -32,7 +32,7 @@ for dir = 'xyz'
legend({'Model', 'Meas.'});
hold off;
% Phase
ax2 = subaxis(2,1,2);
ax2 = subplot(2,1,2);
hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms(['Dg' dir], ['Fg' dir]), freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(meas_sys(['Dm' dir], ['Fm' dir]), freqs, 'Hz'))), '.');
@@ -50,7 +50,7 @@ end
for dir = 'xyz'
figure;
% Amplitude
ax1 = subaxis(2,1,1);
ax1 = subplot(2,1,1);
hold on;
plot(freqs, abs(squeeze(freqresp(G_ms(['Dm' dir], ['Fm' dir]), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(meas_sys(['Dh' dir], ['Fh' dir]), freqs, 'Hz'))), '.');
@@ -60,7 +60,7 @@ for dir = 'xyz'
legend({'Model', 'Meas.'});
hold off;
% Phase
ax2 = subaxis(2,1,2);
ax2 = subplot(2,1,2);
hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms(['Dm' dir], ['Fm' dir]), freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(meas_sys(['Dh' dir], ['Fh' dir]), freqs, 'Hz'))), '.');
@@ -71,7 +71,7 @@ for dir = 'xyz'
hold off;
linkaxes([ax1,ax2],'x');
if save_fig; exportFig(['comp_meas_m_m_' dir], 'normal-normal', struct('path', 'identification')); end
end
@@ -79,7 +79,7 @@ end
for dir = 'xyz'
figure;
% Amplitude
ax1 = subaxis(2,1,1);
ax1 = subplot(2,1,1);
hold on;
plot(freqs, abs(squeeze(freqresp(G_ms(['Dm' dir], ['Fg' dir]), freqs, 'Hz'))));
plot(freqs, abs(squeeze(freqresp(meas_sys(['Dh' dir], ['Fm' dir]), freqs, 'Hz'))), '.');
@@ -89,7 +89,7 @@ for dir = 'xyz'
legend({'Model', 'Meas.'});
hold off;
% Phase
ax2 = subaxis(2,1,2);
ax2 = subplot(2,1,2);
hold on;
plot(freqs, 180/pi*angle(squeeze(freqresp(G_ms(['Dm' dir], ['Fg' dir]), freqs, 'Hz'))));
plot(freqs, 180/pi*angle(squeeze(freqresp(meas_sys(['Dh' dir], ['Fm' dir]), freqs, 'Hz'))), '.');

View File

@@ -2,7 +2,7 @@
figure;
%% Tx
subaxis(2, 3, 1);
subplot(2, 3, 1);
hold on;
plot(error_nass.Time, error_nass.Data(:, 1), 'k-', 'DisplayName', '$\epsilon_x$');
legend();
@@ -10,7 +10,7 @@ hold off;
xlabel('Time (s)'); ylabel('Position (m)');
%% Ty
subaxis(2, 3, 2);
subplot(2, 3, 2);
hold on;
plot(error_nass.Time, error_nass.Data(:, 2), 'k-', 'DisplayName', '$\epsilon_y$');
legend();
@@ -18,7 +18,7 @@ hold off;
xlabel('Time (s)'); ylabel('Position (m)');
%% Tz
subaxis(2, 3, 3);
subplot(2, 3, 3);
hold on;
plot(error_nass.Time, error_nass.Data(:, 3), 'k-', 'DisplayName', '$\epsilon_z$');
legend();
@@ -26,7 +26,7 @@ hold off;
xlabel('Time (s)'); ylabel('Position (m)');
%% Rx
subaxis(2, 3, 4);
subplot(2, 3, 4);
hold on;
plot(error_nass.Time, error_nass.Data(:, 4), 'k-', 'DisplayName', '$\epsilon_{\theta_x}$');
legend();
@@ -34,7 +34,7 @@ hold off;
xlabel('Time (s)'); ylabel('Rotation (rad)');
%% Ry
subaxis(2, 3, 5);
subplot(2, 3, 5);
hold on;
plot(error_nass.Time, error_nass.Data(:, 5), 'k-', 'DisplayName', '$\epsilon_{\theta_y}$');
legend();
@@ -42,7 +42,7 @@ hold off;
xlabel('Time (s)'); ylabel('Rotation (rad)');
%% Rz
subaxis(2, 3, 6);
subplot(2, 3, 6);
hold on;
plot(error_nass.Time, error_nass.Data(:, 6), 'k-', 'DisplayName', '$\epsilon_{\theta_z}$');
legend();

View File

@@ -2,7 +2,7 @@
figure;
%% Tx
subaxis(2, 3, 1);
subplot(2, 3, 1);
hold on;
plot(pos.Time, pos.Data(:, 1), 'k-');
plot(setpoint.Time, setpoint.Data(:, 1), 'k--');
@@ -11,7 +11,7 @@ hold off;
xlabel('Time (s)'); ylabel('Position (m)');
%% Ty
subaxis(2, 3, 2);
subplot(2, 3, 2);
hold on;
plot(pos.Time, pos.Data(:, 2), 'k-');
plot(setpoint.Time, setpoint.Data(:, 2), 'k--');
@@ -20,7 +20,7 @@ hold off;
xlabel('Time (s)'); ylabel('Position (m)');
%% Tz
subaxis(2, 3, 3);
subplot(2, 3, 3);
hold on;
plot(pos.Time, pos.Data(:, 3), 'k-');
plot(setpoint.Time, setpoint.Data(:, 3), 'k--');
@@ -29,7 +29,7 @@ hold off;
xlabel('Time (s)'); ylabel('Position (m)');
%% Rx
subaxis(2, 3, 4);
subplot(2, 3, 4);
hold on;
plot(pos.Time, pos.Data(:, 4), 'k-');
plot(setpoint.Time, setpoint.Data(:, 4), 'k--');
@@ -38,7 +38,7 @@ hold off;
xlabel('Time (s)'); ylabel('Rotation (rad)');
%% Ry
subaxis(2, 3, 5);
subplot(2, 3, 5);
hold on;
plot(pos.Time, pos.Data(:, 5), 'k-');
plot(setpoint.Time, setpoint.Data(:, 5), 'k--');
@@ -47,7 +47,7 @@ hold off;
xlabel('Time (s)'); ylabel('Rotation (rad)');
%% Rz
subaxis(2, 3, 6);
subplot(2, 3, 6);
hold on;
plot(pos.Time, pos.Data(:, 6), 'k-');
plot(setpoint.Time, setpoint.Data(:, 6), 'k--');

View File

@@ -13,7 +13,7 @@
%% Load all the data used for the simulation
load('./mat/sim_conf.mat');
load('sim_conf.mat');
%% Load Controller
load('./mat/controllers.mat');
load('controllers.mat');