MATLAB: I have a file 1×200 struct how can I distribute it to the worker (32 worker)

Dear all, I have a file 1×200 struct, I would like to send it to the cluster (parallel computation), how can I distribute it to the worker (32 worker). I can make it one by one, but it is really take very long time.
Thanks in advance.
Best regards, ahmed

Best Answer

Just create the struct normally before the parfor() loop, and inside the parfor() loop, index the struct by the parfor variable. MATLAB will automatically distribute only the needed portion to each worker.