function M = midl2dfsa(str,alf) M.ALF = alf; M.Q = 1:length(str)+1; % the fewest number of states required M.q0 = 1; M.F = [M.Q(end)]; for i=1:length(str) q1 = i; q2 = i+1; s = str(i); M = set_ddelta(M,q1,s,q2); for t=setdiff(M.ALF,s) M = set_ddelta(M,q1,t,1); end end q = length(str)+1; for t=M.ALF M = set_ddelta(M,q,t,q); end return function M = midl2dfsa0(str,alf) G = [setstar(alf) str setstar(alf)]; M = gregexp2dfsa_fast(G,alf); return