% for parfor function [coorx, coory] = prepareCoord(nodesOffsetx, nodesOffsety, sub_nelx, sub_nely, coorx_full, coory_full) coorx = cell(sub_nely, sub_nelx); coory = cell(sub_nely, sub_nelx); for i = 1:sub_nelx for j = 1:sub_nely coorx{j,i} = coorx_full(squeeze(nodesOffsety(j,i,:)), squeeze(nodesOffsetx(j,i,:))); coory{j,i} = coory_full(squeeze(nodesOffsety(j,i,:)), squeeze(nodesOffsetx(j,i,:))); end end end