# MATLAB: For Loop /Array question

for loophomework

How would i go about creating a for loop to create an array where each value in X is equal to its associated row value * 2 plus its associated column value * 3 +1. Size of array is 50×50 ?

X = zeros(50, 50);[m, n] = size(X); % m x n = 50, 50for i = 1:m % Row    for j = 1:n % Column        X(i, j) = i * 2 + j * 3 + 1;    endend