Removed trap which sometimes gives problems.
parent
180a3bad9c
commit
7cdd0250f8
|
@ -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)));
|
||||
|
|
Loading…
Reference in New Issue