MATLAB: Creating a matrix from vectors

for loop

hallo, i have a vector Ta [12×1] and k[12×1] how could i create a matrix Ta_new [12,31] that the first column is Ta, the second column is Ta+k, the third column would be Ta+2k and so on.. ?

Best Answer

Here's one way:
Ta_new = Ta;
for i = 1:30
Ta_new = [Ta_new Ta+i*k];
end