load('denik.mat') P=zeros(3) P(1,2)=sum(data(:,1)==1&data(:,2)==2)/sum(data(:,1)==1) P(1,1)=sum(data(:,1)==1&data(:,2)==1)/sum(data(:,1)==1) P(1,3)=sum(data(:,1)==1&data(:,2)==3)/sum(data(:,1)==1) % už vidím, jak to funguje, lze to napsat do dvojitého for cyklu, tady 2x for cyklus for i=1:3 P(2,i)=sum(data(:,1)==2&data(:,2)==i)/sum(data(:,1)==2); end P for i=1:3 P(3,i)=sum(data(:,1)==3&data(:,2)==i)/sum(data(:,1)==3); end P mc = dtmc(P); figure; graphplot(mc,'ColorEdges',true); numSteps=200 [V,D]=eig(P') figure bar(V(:,1)/sum(V(:,1))*(2501)) V(:,1)/sum(V(:,1))