From 7cdd0250f8d0126d71238dc2b85755001f861a2e Mon Sep 17 00:00:00 2001 From: Marco Ratto Date: Mon, 2 May 2011 11:03:56 +0200 Subject: [PATCH] Removed trap which sometimes gives problems. --- matlab/cosn.m | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/matlab/cosn.m b/matlab/cosn.m index 76f2295e9..7d60c88e5 100644 --- a/matlab/cosn.m +++ b/matlab/cosn.m @@ -27,14 +27,7 @@ function [co, b, yhat] = cosn(H); y = H(:,1); X = H(:,2:end); -% y = H(:,1); -% X = H(:,2:end); - -if size(X,2)==1; - b=1; -else - b=(X\y); -end +b=(X\y); yhat = X*b; if rank(yhat), co = abs(y'*yhat/sqrt((y'*y)*(yhat'*yhat)));