From fd09ba1fca3e5e152a06cd0d9a6a2432c3bd857b Mon Sep 17 00:00:00 2001 From: Houtan Bastani Date: Tue, 5 Feb 2019 16:38:25 +0100 Subject: [PATCH] ols_style parsing: remove regressors that are equal to zero --- matlab/ols/parse_ols_style_equation.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/matlab/ols/parse_ols_style_equation.m b/matlab/ols/parse_ols_style_equation.m index cd93e4de2..7a2289ac3 100644 --- a/matlab/ols/parse_ols_style_equation.m +++ b/matlab/ols/parse_ols_style_equation.m @@ -179,6 +179,12 @@ end Y = Y(fp:lp); if ~isempty(X) X = X(fp:lp); + names = X.name; + for i = 1:length(names) + if all(X.(names{i}).data == 0) + X = X.remove(names{i}); + end + end end if ~isempty(lhssub) lhssub = lhssub(fp:lp);