function str = printsymb(m,n) global style global nstate nstate = m; %style = 'matl'; % matlab style style = 'math'; % mathematica style ALLSEQ = list_all_ind(repmat(m,1,n)); if strcmp(style,'math') %ALLSEQ = ALLSEQ-1; end str = ''; % here we take i=1 and X_i=0, as in the paper for i=1:size(ALLSEQ,1) x = ALLSEQ(i,:); stri = p0str(x); for j=2:n-1 stri = [stri pjstr(x,j)]; end stri = [stri phstr(x)]; str = [str '+' stri]; end if 0 if strcmp(style,'math') str = strrep(str,'a0[1]','1'); for c=['0' num2str(2:m)] str = strrep(str,['a0[' c ']'],'0'); end end end if 0 redun = 'A[x1,x2,x3]'; for t=1:m-1 redunjt = strrep(redun, 'x2',num2str(j)); redunjt = strrep(redunjt,'x3',num2str(t)); substr = '(1'; for i=1:m-1 redunijt = strrep(redunjt,'x1',num2str(i)); substr = [substr '-' redunijt]; end redunjt = strrep(redunjt,'x1',num2str(m)); substr = [substr ')']; str = strrep(str,redunjt,substr); end end return function str = p0str(x) global style if strcmp(style,'math') str = ['a0[' num2str(x(1)) ']']; else str = ['C' num2str(x(1)) ')']; end return function str = pjstr(x,j) global style global nstate m = nstate t = x(j); xi = x(j+1); xj = x(j); %if xi==m if 0 str = '(1'; for xi=1:m-1 if strcmp(style,'math') str = [str '-' 'A[' num2str(x(j+1)) ',' num2str(x(j)) ',' num2str(j) ']']; else str = [str '-' 'A(' num2str(x(j+1)) ',' num2str(x(j)) ',' num2str(j) ')']; end end else if strcmp(style,'math') %str = ['a' num2str(j) '[' num2str(x(j+1)) ',' num2str(x(j)) ']']; str = ['A[' num2str(x(j+1)) ',' num2str(x(j)) ',' num2str(j) ']']; else str = ['A(' num2str(x(j+1)) ',' num2str(x(j)) ',' num2str(j) ')']; end end return function str = phstr(x) x0 = x; %x0(1) = 0; x0(1) = 1; x0str = num2str(x0); x1str = num2str(x ); %x0str = strrep(x0str,' ',''); %x1str = strrep(x1str,' ',''); x0str = strrep(x0str,' ',','); x0str=strip_double_delim(x0str,',') x1str = strrep(x1str,' ',','); x1str=strip_double_delim(x1str,',') %phstr0 = ['f' x0str]; %phstr1 = ['f' x1str]; phstr0 = ['F[' x0str ']']; phstr1 = ['F[' x1str ']']; if length(x>=2) %astr0 = ['a1[' num2str(x(2)) ',' num2str(0) ']']; %astr1 = ['a1[' num2str(x(2)) ',' num2str(x(1)) ']']; astr0 = ['A[' num2str(x(2)) ',' num2str(1) ',1]']; astr1 = ['A[' num2str(x(2)) ',' num2str(x(1)) ',1]']; str = ['(' astr0 phstr0 '-' astr1 phstr1 ')']; else str = ['(' phstr0 '-' phstr1 ')']; end return