function read_margrep(fname) fstr = file2str(fname); %iiq = findstr(fstr,'The states Q'); MM = read_mm(fstr); iim = findstr(fstr,'[mar'); %if length(iiq)~=length(iim) if length(MM)~=length(iim) %error('length mismatch') MM = MM(1:end-1); end for j=1:length(MM) M = MM(j); strj = fstr(iim(j):end); k = findstr(strj,']'); mstr = strj(1:k-1); ie = find(mstr=='='); mstr = mstr(ie+1:end); gam = str2num(mstr); if gam > 0 hold on plot(length(M.Q),gam,'o'); drawnow end end return function MM = read_mm(fstr) fstr = strrep(fstr,'--','#'); fstr = strrep(fstr,'#-','#'); ee = text2cell_adv(fstr,'','#'); ee = ee(2:end); MM = []; for i=1:length(ee) fstr = ee{i}; M = read_dfsa(fstr); MM = [MM;M]; end return