?? pinbixiaoneng.m
字號:
function retstr = firstTest(instruct, outfile)%FUNCTION_TEMPLATE Guide for creating MATLAB Web Server applications.% <FUNCTION_TEMPLATE>(INSTRUCT) where you replace the% "<FUNCTION_TEMPLATE>" with the name of the MATLAB Web % Server application you wish to create.% <FUNCTION_TEMPLATE>(INSTRUCT, OUTFILE) is the same as% the single argument version but also includes an optional% argument, OUTFILE, for writing HTML output to a file (for% stand-alone testing).%% Modify this file to create your own application. Be sure% to save the modifications as <FUNCTION_TEMPLATE>.m where% <FUNCTION_TEMPLATE> is replaced with the name of your % application M-file.%% INSTRUCT is a structure created by the matweb program.% It contains fields corresponding to the HTML form fields% in the HTML form that you have created from the file% INPUT_TEMPLATE.HTML. In that HTML file there% should a hidden field, called "mlmfile" that references% the M-file that you create here.% % Author(s): M. Greenstein, 05-18-98% Copyright 1998-2001 The MathWorks, Inc.% $Revision: 1.7 $ $Date: 2001/04/25 18:49:24 $% STEP 1% Initialize the return string.retstr = char('');% STEP 2% Set working directory. The variables INSTRUCT.MLDIR % and INSTRUCT.MLID are provided automatically to all% MATLAB Web Server applications that use the matweb program.% Use the directory in MLDIR for writing graphics files % in a location that the HTTPD can read.cd(instruct.mldir);% STEP 3% Get the HTML form input variables (from the HTML form that% you created from INPUT_TEMPLATE.HTML) and use them in your% program. See the sample M-files in the wsdemos directory% for examples.P.Length = str2double(instruct.Length);P.Width = str2double(instruct.Width);P.Frequency = str2double(instruct.Frequency);P.Diameter = str2double(instruct.Diameter);P.Thickness = str2double(instruct.Thickness);P.conductivity = str2double(instruct.conductivity);P.hole_space = str2double(instruct.hole_space);% STEP 4% Perform your MATLAB computations, graphics file creations,% etc. here:%SEe=20*log10(P.Space^2*sqrt(P.Length*P.Width)/(P.Diameter^3))+41.8*P.Thickness/P.Diameter+2.68;%SEm=20*log10(P.Space^2*sqrt(P.Length*P.Width)/(P.Diameter^3))+32*P.Thickness/P.Diameter+3.83;A=32*P.Thickness/P.Diameter;N=5.79e-5*P.Frequency*P.Thickness;R=20*log10((1+N)^2/(4*N));if SEe=% STEP 5% Put variables that you want to put into your HTML output document% in an output structure. You create an HTML output document from% OUTPUT_TEMPLATE.HTML. See the sample M-files in the wsdemos% directory for examples.outstruct.SEe = SEe;outstruct.SEm = SEm;% STEP 6% Call the function HTMLREP with the output structure you just% created and the file name 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('shield2.html');if (nargin == 1) retstr = htmlrep(outstruct, templatefile);elseif (nargin == 2) retstr = htmlrep(outstruct, templatefile, outfile);end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -