clc; clear; close all file_k = 1; %% Read file and assign variables fileNames = dir('*tv_IMC_2Harm_L2_b10292012_1242*.mat'); for j = 1 : max(size(fileNames)) TEMP_IDX(j) = fileNames(j).datenum; end [TEMP IDX] = sort(TEMP_IDX,'descend'); disp(fileNames(IDX(file_k)).name); load(fileNames(IDX(file_k)).name); clc; disp(fileNames(IDX(file_k)).name); t = t - 7; t = downsample(t,10); r = downsample(r,10)+0.325; y = downsample(y,10)+0.325; e = downsample(e,10); u = downsample(u,10)+0.325; zoom1 = [0 1]; zoom2 = [max(t)-0.1 max(t)]; maxT = floor(max(t)); e1 = -0.3 * ones(size(t)); e2 = 0.3 * ones(size(t)); figure('Name','TrackingData_2Harmonic'); scaleData = [5 6]*1.125; set(gcf, 'PaperPosition', [1 7 scaleData]); subplot(4,2,[1 2]); plot(t,r,'-k','Linewidth',1); hold on; grid on; ylabel('r (mm)'); ylim([-1 4]+0.325); xlim([0 max(t)]); % xlabel('t (s)'); subplot(4,2,[3 4]); plot(t,e1,'--m','Linewidth',0.75); hold on; grid on; subplot(4,2,[3 4]); plot(t,e,'-g','Linewidth',1); hold on; grid on; subplot(4,2,[3 4]); plot(t,e2,'--m','Linewidth',0.75); hold on; grid on; ylabel('e (mm)'); ylim([-2.5 2.5]); xlim([0 max(t)]); legend('+/- 0.3mm'); % xlabel('t (s)'); subplot(4,2,5); plot(t,y,'-r','Linewidth',1); hold on; grid on; subplot(4,2,5); plot(t,r,'-k','Linewidth',1); hold on; grid on; ylabel('r, y (mm)');ylim([-2 5]+0.325); xlim(zoom1); % xlabel('t (s)'); subplot(4,2,6); plot(t,y,'-r','Linewidth',1); hold on; grid on; subplot(4,2,6); plot(t,r,'-k','Linewidth',1); hold on; grid on; ylabel('r, y (mm)');ylim([-2 5]+0.325); xlim(zoom2); % xlabel('t (s)'); idx = find(t > 0); uLim1 = (min(u(idx))) * 1.2; uLim2 = (max(u(idx))) * 1.2; subplot(4,2,7); plot(t,u,'-b','Linewidth',1); hold on; grid on; ylabel('u (mm)'); xlim(zoom1); ylim([uLim1 uLim2]) xlabel('t (s)'); subplot(4,2,8); plot(t,u,'-b','Linewidth',1); hold on; grid on; ylabel('u (mm)'); xlim(zoom2); ylim([uLim1 uLim2]) xlabel('t (s)');