"store the variable "vetor_momentoj" [...] in terms of the indexes i and j."
Something like this? I replaced the calculation of momentoj by rand to be able to run the script.
There is no reason to have the statement jvals = linspace(0, 0.03, 10); inside the loop. The value of jvals doesn't change.
jvals = linspace(0, 0.03, 10);
vetor_momentoj = nan( numel(jvals), it );
vetor_momentoj(j,i) = rand;
"store the variable "jvals"." I don't see why. The statement jvals(i) = linspace(0, 0.03, 10); throws an error. repmat( linspace(0,0.03,10), .... ) outside the script, isn't that good enough?