0 0 1 1
1 1 2 2
2 2 3 3
3 3 4 4
4 4 5 5
I want to make matrix like above without for loops. I only know how to do it with a loop. This is my code
x = [0 0 1 1];
for i = 1:4
x= [x;x(1,:)+i]
end
Is there a way in a vector like function ':'? Or in other ways. I want to know how to insert an increased element value into a matrix row without loop.