SpecifyingStartup Options in the MATLAB Startup File Atstartup, MATLAB automatically executes the file matlabrc.m and,if it exists,startup.m.The file matlabrc.m,which is in the matlabroot/toolbox/local folder,is reserved for use by MathWorks and by the system manager onmultiuser systems. Thefile startup.m isfor you to specify startup options. For example, you can modify thedefault search path, predefine variables in your workspace, or definedefaults for Handle Graphics® objects.Use the following statements in a startup.m fileto add the specified folder, /home/username/mytools,to the search path, and to change the current folder to mytools uponstartup. addpath /home/username/mytoolscd /home/username/mytoolsPlacethe startup.m filein the default or current startup folder, which is where MATLAB firstlooks for it. For more information, see .CommonlyUsed Startup Options Thefollowing table provides a list of some commonly used startup optionsfor both Windows and UNIX® platforms.For more information, including a complete list of startup options,see the matlab(Windows) referencepage or the matlab(UNIX) referencepage.
PassingPerl Variables on Startup Youcan pass Perl variables to MATLAB on startup by usingthe -r optionof the matlabfunction.For example, assume a MATLAB function test thattakes one input variable: function test(x)Tostart MATLAB with the function test,use the command matlab -r "test(10)"Onsome platforms, you might need to use double quotation marks: matlab -r "test(10)"Thiscommand starts MATLAB and runs test withthe input argument 10. Topass a Perl variable instead of a constant as the input parameter,follow these steps.
Formore information, see the matlab(Windows) or matlab(UNIX) referencepage. Startupand Calling Java Software from the MATLAB Program Whenthe MATLAB program starts, it constructs the class path for SunMicrosystems Java software using librarypath.txt aswell as classpath.txt.If you call Java software from MATLAB, see more about this in TheJava Class Path and LocatingNative Method Libraries inthe MATLAB External Interfaces documentation. |
GMT+8, 2024-11-24 21:58 , Processed in 0.032563 second(s), 16 queries , Gzip On.
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.