diff --git a/matlab/ols/put_in_sur_form.m b/matlab/ols/put_in_sur_form.m index cbf1bb9bb..7ed8fe35b 100644 --- a/matlab/ols/put_in_sur_form.m +++ b/matlab/ols/put_in_sur_form.m @@ -76,7 +76,7 @@ for i = 1:neqs end end for j = length(to_remove):-1:1 - Xtmp = Xtmp.remove(Xtmp.name{j}); + Xtmp = Xtmp.remove(Xtmp.name{to_remove(j)}); end if ~isempty(Xtmp) Xmat = [Xmat Xtmp];