本帖最后由 Jillian 于 2012-10-18 06:41 编辑
参考资料:
mathwork关于matlab启动参数的介绍: http://www.mathworks.cn/help/techdoc/matlab_env/f8-4994.html SpecifyingMATLAB Startup Options Youcan specify startup options (also called command flags or commandline switches) that instruct the MATLAB program to perform certainoperations when you start it. On all platforms, you specify theoptions as arguments to the matlab command when you start is at theoperating system prompt. For example, the following starts MATLAB andsuppresses the display of the splash screen. matlab-nosplash OnWindows platforms, you can precede a startup option with either ahyphen (-) or a slash (/). For example, -nosplash and /nosplash areequivalent. Onall platforms, you can also specify startup options using a MATLABstartup file—see Specifying Startup Options in the MATLAB StartupFile OnWindows platforms, you can specify startup options in the MATLABshortcut—see Including Startup Options in a Shortcut on WindowsSystems.
IncludingStartup Options in a Shortcut on Windows Systems
Youcan add selected startup options (also called command flags orswitches for the command line) to the target path for your shortcutin the Windows environment for MATLAB. For more information about theoptions, see CommonlyUsed Startup Options. Touse startup options for the MATLAB shortcut icon in a Windowsenvironment, follow these steps: Right-clickthe shortcut icon for MATLAB andselect Properties from the context menu. TheProperties dialog box for MATLAB opens to the Shortcut pane. Inthe Target field,after the target path for matlab.exe,add the startup option, and click OK.For example, adding -r"filename" runsthe MATLAB code file filenameafterstartup.
Thisexample instructs MATLAB to automatically run the file results afterstartup, whereresults.m isin the startup folder or on the search path for MATLAB. The statementin the Target fieldmight appear as C:\Program Files\MATLAB\R2010b\bin\matlab.exe -r "results"Includethe statement in double quotation marks ("statement").Use only the file name, not the file extension or path name. Forexample, MATLAB produces an error when you run ... matlab.exe -r "D:\results.m"Usesemicolons or commas to separate multiple statements. This examplechanges the format to short,and then runs the MATLAB code file results: ... matlab.exe -r "format('short');results"Separatemultiple options with spaces. This example starts MATLAB withoutdisplaying the splash screen, and then runs the MATLAB codefile results: ... matlab.exe -nosplash -r "results"
|