Installation guide
2 Getting Started
2-8
% created and the filename you created from
OUTPUT_TEMPLATE.HTML.
% Replace <OUTPUT_TEMPLATE.HTML> with the name of the HTML
output
% file you created using OUTPUT_TEMPLATE.HTML.
% This call fills the string RETSTR to return and optionally
% writes the output as a file if a valid filename is given
as the
% second argument to the present function.
templatefile = which('<OUTPUT_TEMPLATE.HTML>');
if (nargin == 1)
retstr = htmlrep(outstruct, templatefile);
elseif (nargin == 2)
retstr = htmlrep(outstruct, templatefile, outfile);
end
webmagic M-File
The data entered on the webmagic1.html input document is
automatically passed to MATLAB, which then runs the
webmagic
function. Notations in boldface refer to steps in the M-file template.
% Initialize the return string. (Step 1)
retstr = char('');
(Step 2. Not needed. No generated graphics.)
% Get the msize (string) variable. Convert to a number. (Step
3)
% Check the range.
if(~length(instruct.msize))
msize = 3; % Default empty field.
else
msize = str2double(instruct.msize);
if (msize > 20), msize = 20; end % Max size.
if (msize < 3), msize = 3; end % Min square.
end
% Save size as a char string in structure OUTSTRUCT.
(Step
4, 5)
outstruct.msize = msize;