Hi. You are absolutely right about the third dimension of the output tensor. I have corrected it now.
why do you think the syntax does not work? what error are you getting?
I am getting "variable in a The variable in a parfor cannot be classified". Which should be expected since in a parfor with a nested for loop, the variables running one loop should not communicate with the other ones. They should be independent.