MATLAB: Create matrix with step of columns

MATLABmatrix manipulation

clear; clc;
v = 1:257;
n = 10;
k = 7;
newV = (repmat(v, n, 1) + k) .* 2.^(0:(n-1))' - k;
Now I have a matrix with first column, for example if k=7, I have [1;9;25;57;121], but I need column [1;9;17;25;33;41].
How to do this?

Best Answer

newV = (0:n-1).'*k + v;
Related Question