MATLAB Examples

Contents

Portfolio Optimization Demo (with Distributed Arrays and SPMD)

clear all

Submitting a Script that Uses SPMD

numFiles = 4; % number of files to use
numStocks = 200; % number of stocks to use
numPoints = 10;  % number of points on the efficency frontier

job = batch('Exercise6_OptimScriptSPMD','matlabpool',2, 'Configuration', defaultParallelConfig());

Wait for results and load back into the client workspace

wait(job);
load(job);

Visualization

fig2 = figure;
Exercise6_plot_optim(fig2, risk, ret);

Destroy job

destroy(job);