I'm trying to create a loop for a probability distribution. My initial condition is $p_0 = (1, 0, 0, 0, 0)$, $T$ = [0 1/3 1/3 1/3 0; 1/2 0 1/2 0 0; 1/3 1/3 0 1/3 0; 1/3 0 1/3 0 1/3; 0 0 0 1 0], (T is a five by five matrix)
and I am trying to find the probability distribution for the first 50 steps my using $p_n = p_0*T$ however I keep getting error messages. I'm not good with coding, this is what I have so far:
for n= 1:50;
p(n)= p(n-1)*(T);
end
Any code suggestions?