Function Rs = Mtest(H, Outfile)
Total Page:16
File Type:pdf, Size:1020Kb
CODE
Link m-file between DDA application and MWS
Webfun.m function Webfun(ParList,menuchoice,menuitems,returnfilename) % DDA application m-file for the link to Matlab Web Server % Authors Inger Bolin & Maria Borg % Date: 2002-03-08
%Give the file a static name sendfile='c:\temp\ABBfile.mat';
%Save all parameters needed for calculations save(sendfile, 'ParList','menuchoice','menuitems','returnfilename');
%Start the HTML input document stat = web('http://C4000129/indexphp.php?filename=ABBfile.mat&filepath= C:/temp/ABBfile.mat', '-browser');
Input HTML document indexphp.php
MWS application m-file for calculation mtest.m function rs = mtest(h, outfile) % MWS application m-file for the compiled DDA application, advanced calculations % through a web server % Authors Inger Bolin & Maria Borg % Date: 2002-03-08
% Set to MWS directory cd(h.mldir);
% Save input file to local variable filename = h.filename;
% Load .mat-file into workspace load(filename);
% Delete the input file from MWS directory delete(filename);
2 % Call to simprocess() for calculation if isempty(ParList) data=simprocess('', menuchoice, menuitems, data); else data=simprocess(ParList, menuchoice, menuitems); end
% Call to datahistory() datahistory(data); data_history=evalin('base','data_history');
% Make an unique result file using parameter from customer resfile=returnfilename;
% Save in structure ready for plotting if exist('data_history') Session.DataHistory=data_history; else error ('Failed updating data_history'); end
% Save workspace to result file save(resfile,'Session');
% Save to output structure s.filename = resfile; s.mlid=h.mlid; s.mldir=h.mldir;
% Output the output structure to output HTML document path = which('output.html'); if(nargin == 1) rs = htmlrep(s, path); elseif(nargin == 2) rs = htmlrep(s, path, outfile); end
Output HTML document output.html
Result file successfully executed!
Download $filename$ to your disc
3 CONFIGURATION FILES
To connect with MWS matweb.exe requires information stored in matweb.conf matweb.conf
[mtest] mlserver=127.0.0.1 mldir=C:/matlab6p1_web/toolbox/webserver/wsdemos
Initial settings for MWS matlabserver.conf
-m 1
4