Installation guide

Creating MATLAB Web Server M-Files
2-9
% Create magic square in output structure OUTSTRUCT.
outstruct.msquare = magic(msize);
% Get column, row, and diagonal sum. Put in OUTSTRUCT.
d = sum(outstruct.msquare,1);
outstruct.msum = d(1,1);
% Output the results and optionally write as a file if the
% filename was given as the second argument to WEBMAGIC.
(Step 6)
templatefile = which('webmagic2.html');
if (nargin == 1)
retstr = htmlrep(outstruct, templatefile);
elseif (nargin == 2)
retstr = htmlrep(outstruct, templatefile, outfile);
end