rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
delzerocolumns.m
Go to the documentation of this file.
1 function Xdel = delzerocolumns(X,epsilon,A)
2 %function Xdel = delzerocolumns(X[,epsilon,A])
3 % function deleting zero-columns from matrix 'X'.
4 %
5 % Detection by `norm^2<\varepsilon`. Optionally, the inner-product-matrix 'A' can be
6 % additionally passed for correct computation of the inner product.
7 %
8 % Parameters:
9 % X: matrix whose zero columns shall be eliminated
10 % epsilon: tolerance value `\varepsilon`
11 % A: optional inner product matrix used for norm computation (Default: `1`)
12 %
13 % Return values:
14 % Xdel: matrix whose zero columns are deleted
15 
16 % Bernard Haasdonk 20.7.2006
17 
18 if nargin<3
19  A = 1;
20 end;
21 
22 if nargin<2 || isempty(epsilon)
23  epsilon=eps;
24 end;
25 
26 i = find(sum(X.*(A*X))>epsilon);
27 if ~isempty(i)
28  Xdel = X(:,i);
29 else
30  Xdel=zeros(size(X,1),0);
31 end;
32 
function Xdel = delzerocolumns(X, epsilon, A)
function deleting zero-columns from matrix X.