daniele@160: function varargout = Spark(obj) daniele@160: % Calculates the minimum number of linearly dependent atoms in the matrix A daniele@160: % WARNING: this function computes a combinatorial function, use only if the daniele@160: % size of the problem is small (i.e. <20) daniele@160: if nargout <= 1 daniele@160: A = obj.phi; daniele@160: k = size(A,2); daniele@160: if k>20 daniele@160: warning('This function computes a combinatorial function, use only if thesize of the problem is small (i.e. <20).'); daniele@160: choice = input('The calculation of spark will take a long time... do you wish to continue anyway (y/n)','s'); daniele@160: if strcmpi( choice,'n') daniele@160: return daniele@160: end daniele@160: end daniele@160: sigma = 2; daniele@160: while true daniele@160: P = nchoosek(1:k,sigma); daniele@160: for i=1:size(P,1) daniele@160: r = rank(A(:,P(i,:))); daniele@160: if r