I have these nested for-loops that I would like to convert to parfor:
row = 1;
for i = 5 : 0.2 : 5.4
col = 1;
for j = 2 : 0.5 : 2.5
matrx(row, col) = i * j;
col = col + 1;
end
row = row + 1;
end
Does anyone any way in which this would be possible?
I hope you're only displaying an extremely simplified version of your code, but anyways, the secret to parfor can be found by listening to Matlab numerous messages and reading the documentation. Start by learning good Matlab coding practices, and streamlining your code in such a way to fit your data into what Matlab wants in a
parfor
loop.Things to note:
This is one way I would do it, although it depends on your final application