MATLAB: Vector addition in a single row

homeworkvector addition

for a constant w=2 a matrix is to be generated by incrementing it as many times and save it in another matrix as the following way out=[w+1 w+2 w+3 w+4…….]

Best Answer

w = 2;
N = 10; % N value may be anything as the length u need..
for i = 1 : N
out(i)=[w+i];
end