MATLAB: How to write code for hankle and toeplitz matrix

how to write code for hankle and toeplitz matrix?

I have matrices like
F = [CA;CA^2;CA^3;CA^4;CA^5;CA^6;CA^7;CA^8;CA^9;CA^10]
and other matrix is
phi=[CB 0 0 0;
CAB CB 0 0;
CA^2B CAB CB 0;
CA^3B CA^2B CAB CB;
CA^4B CA^3B CA^2B CAB;
CA^5B CA^4B CA^3B CA^2B;
CA^6B CA^5B CA^4B CA^3B;
CA^7B CA^6B CA^5B CA^4B;
CA^8B CA^7B CA^6B CA^5B;
CA^9B CA^8B CA^7B CA^6B]
How can I do matlab coding for these matrices

Best Answer

My apologies! I was not thinking clearly when I wrote the nonsensical A.^(0:9). The following should produce the desired two arrays.
M = 6; % A is M x M, B is M x 1, C is 1 x M
N = 10;
F = zeros(N+1,M);
F(1,:) = C;
for k = 2:N+1
F(k,:) = F(k-1,:)*A;
end
r = F(1:N,:)*B;
c = [C*B;zeros(M-1,1)];
phi = toeplitz(r,c);
F = F(2:N+1,:);