function X = getptsample(M) %X0 = simple_paths(M); X0 = simpathcover(M); c = char(X0); ell = size(c,2); [X,Y] = reglang_posneg_dense(0,ell,M); return X = {}; %SS = {}; for i=1:length(X0) R = spath2cell(M,X0{i}); R1 = {}; for j=1:length(R) r = strrep(R{j},'@',''); if ~isempty(r) R1{end+1}=r; end end RS = list_all_ind_g(R1); for j=1:size(RS,1) s = RS(j,:); %s = cell2str(R,''); %s = strrep(s,'@',''); %SS{end+1} = strrep(s,'@',''); fprintf('%d of %d: extracting features from %s \n',i,length(X0),s); X = [X; getfeatures(s)]; end end X = unique(X); return function SS = getfeatures(x) N = length(x); %PROGstart(2^N,['extracting features from "' x '"']); PROGstart(2^N); SS = repmat({x},2^N,1); for i=1:2^N setstr = dec2bin(i-1,N); ii1 = find(setstr=='1'); SS{i} = x(ii1); PROGupdate(i); end PROGend; SS = unique(SS); return