Start with this outline:
x = your initial variable of values
[m,n] = size(x);
result = zeros(___,___);
for k=1:___
result(k) = ______;
end
The indexing will be some expression involving m and/or n. The expression will be some expression involving two values from x (with the appropriate indexing). Fill in the blanks as best you can, and then when you have problems post follow-up comments showing your code, telling us what errors you are getting, and asking specific questions about it.
Best Answer