I have made one simulink model, which takes workspace variables during simulation. I put the below code inside a for loop.
in = Simulink.SimulationInput(model);
simOut = parsim(in,'TransferBaseWorkspaceVariables','on');
While running the complete program (for loop containing above code) MATLAB took a lot of time to transfer the workspace variables in each worker and also it took considerable amount of time to load simulink model in each worker. For running the above code I used 2 workers. I found that the time taken to run the complete program using parallel computing toolbox (using parsim command) is more than the normal simulation time without parallel computing toolbox. I used PCs with 2 workers and 8 workers but the simulation using parallel computing took more time in both cases.
So give me a solution to speed up my simulation using parallel computing toolbox.