rbmatlab 0.10.01
general/vecmat/delzerocolumns.m
Go to the documentation of this file.
00001 function Xdel = delzerocolumns(X,epsilon,A)
00002 %function Xdel = delzerocolumns(X[,epsilon,A])
00003 % function deleting zero-columns from matrix 'X'.
00004 %
00005 % Detection by `norm^2<\varepsilon`. Optionally, the inner-product-matrix 'A' can be
00006 % additionally passed for correct computation of the inner product.
00007 %
00008 % Parameters:
00009 %  X: matrix whose zero columns shall be eliminated
00010 %  epsilon: tolerance value `\varepsilon`
00011 %  A: optional inner product matrix used for norm computation (Default: `1`)
00012 %
00013 % Return values:
00014 %  Xdel: matrix whose zero columns are deleted
00015 
00016 % Bernard Haasdonk 20.7.2006
00017 
00018 if nargin<3
00019   A = 1;
00020 end;
00021 
00022 if nargin<2 || isempty(epsilon)
00023   epsilon=eps;
00024 end;
00025 
00026 i = find(sum(X.*(A*X))>epsilon);
00027 if ~isempty(i)
00028   Xdel = X(:,i);
00029 else
00030   Xdel=zeros(size(X,1),0);
00031 end;
00032 
All Classes Namespaces Files Functions Variables