The problem is that PARFOR doesn't know how to 'slice' your variables T and X because the indexing expression you're using is too complicated. There are more detailson this page, but basically I think it should work to do this:
% pre-allocate rectangular T and X.
T = zeros(50, 101);
X = zeros(50, 101);
parfor i = 1:101
...
% Assign whole columns of T and X using 'i' as the slicing index
Best Answer