MATLAB: Matrix operation make matrix

matrix

i want to make matrix. for manual way or the output
A=[1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 ... 8 8 8 8 8 8 8 8];
for A, each value until 8 times the value will be add by 1.
b=[1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 ... 1 2 3 4 5 6 7 8];
for b, value 1-8 will be looping until 8 times.
so the size A is 1×64 and B is 1×64

Best Answer

a=repmat(1:8,8,[]);
b=a'
a=a(:)'
b=b(:)'