From 1921d2696b72c3445d067ff52646e769905cacf4 Mon Sep 17 00:00:00 2001 From: Olivier Blancke <33840238+oblancke@users.noreply.github.com> Date: Mon, 20 Nov 2017 14:44:45 -0500 Subject: [PATCH 1/2] Update Tester.m (solve matrix dimension error) An update to solve matrix dimension error in line 29 when caculating RUL.values. Works wells after modification. Proposed changes: _____ 29: prognosisData.RUL.values=prognosisData.EOL.values - prognosisData.time; -> 29: prognosisData.RUL.values=ones(N_sam,Time_Max) for i = 1:N_sam for j=1:Time_Max prognosisData.RUL.values(i,j)=prognosisData.EOL.values(i,j) - prognosisData.time(j); end end ____ --- Tester.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Tester.m b/Tester.m index 65132f2..5c4feb6 100644 --- a/Tester.m +++ b/Tester.m @@ -26,7 +26,12 @@ prognosisData.RUL.true=prognosisData.EOL.true - prognosisData.time; % .RUL.values = (N x t) RUL prediction values at each prediction % time. - prognosisData.RUL.values=prognosisData.EOL.values - prognosisData.time; + prognosisData.RUL.values=ones(N_sam,Time_Max) + for i = 1:N_sam + for j=1:Time_Max + prognosisData.RUL.values(i,j)=prognosisData.EOL.values(i,j) - prognosisData.time(j); + end + end % .RUL.weights = (N x t) RUL prediction weights at each prediction % time. prognosisData.RUL.weights=prognosisData.EOL.weights; @@ -53,4 +58,4 @@ M = computePrognosisMetrics(prognosisData,alphaBeta,sigma); plotAlphaLambda(prognosisData,alphaBeta(1),alphaBeta(2)) -% \ No newline at end of file +% From d081a4063c8e7b3fe833f77f9e2aff59fc006d56 Mon Sep 17 00:00:00 2001 From: Olivier Blancke <33840238+oblancke@users.noreply.github.com> Date: Tue, 21 Nov 2017 10:58:37 -0500 Subject: [PATCH 2/2] Update plotAlphaLambda.m to solve boxplot error Proposed changes: -To solve the boxplot error with tukey style: line 194 and 201 change "." by "-"; -To set style well shape for Tester.m line 187 and 189 change /2 by /6 (to change boxplot width); line 40 to 42 change option "tukey", xb, yb, xr, yr; --- +PrognosticsMetrics/plotAlphaLambda.m | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/+PrognosticsMetrics/plotAlphaLambda.m b/+PrognosticsMetrics/plotAlphaLambda.m index 4f5f0b5..777f872 100644 --- a/+PrognosticsMetrics/plotAlphaLambda.m +++ b/+PrognosticsMetrics/plotAlphaLambda.m @@ -37,9 +37,9 @@ % set up default options options = struct('boxFill',[.4 .5 .6],'coneFill',[.95 .95 .95],'width',1,... - 'timeUnits','s','showResults',1,'xR',-3,'yR',10,'xB',-3,'yB',5,... - 'printSummary',0,'FontName','Times','textColor',[0 0 0],'lineColor',[0 0 0],... - 'style','tufte','MarkerSize',3,'FontSize',10,'UTParams',[],'completeLegend',0,... + 'timeUnits','s','showResults',1,'xR',-0.15,'yR',0.5,'xB',-0.15,'yB',0.9,... + 'printSummary',1,'FontName','Times','textColor',[0 0 0],'lineColor',[0 0 0],... + 'style','tukey','MarkerSize',3,'FontSize',10,'UTParams',[],'completeLegend',0,... 'name','RUL'); if nargin>3 @@ -184,21 +184,21 @@ case 'tukey' % make the box - h = patch([k-width/2 k+width/2 k+width/2 k-width/2],[Q(1) Q(1) Q(3) Q(3)],fillColor); + h = patch([k-width/6 k+width/6 k+width/6 k-width/6],[Q(1) Q(1) Q(3) Q(3)],fillColor); boxhandles = h; - h = line([k-width/2 k+width/2],[Q(2) Q(2)]); + h = line([k-width/6 k+width/6],[Q(2) Q(2)]); set(h,'Color',options.lineColor); % mark the mean h = line(k,mean(Y)); - set(h,'LineStyle','.','Marker','o','Color',options.lineColor,'MarkerFaceColor',options.lineColor); + set(h,'LineStyle','-','Marker','o','Color',options.lineColor,'MarkerFaceColor',options.lineColor); boxhandles(end+1) = h; % plot confidence line (whiskers) h = line([k k],[percentile(Y,.05) percentile(Y,.95)]); set(h,'Color',options.lineColor); h = line([k k],[percentile(Y,.05) percentile(Y,.95)]); - set(h,'LineStyle','.','Marker','+','Color',options.lineColor); + set(h,'LineStyle','-','Marker','+','Color',options.lineColor); boxhandles(end+1) = h; upperMark = [k percentile(Y,.95)]; @@ -239,4 +239,3 @@ -