声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

声振论坛 展示 基础理论 查看内容

使用php在网页执行matlab

2012-10-18 06:57| 发布者: aspen| 查看: 14831| 评论: 0|原作者: Jillian|来自: 振动论坛

摘要: 目录 IncludingStartup Options in a Shortcut on Windows Systems SpecifyingStartup Options in the MATLAB Startup File CommonlyUsed Startup Options PassingPerl Variables on Startup Startupand Callin ...
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.


Platform

Option

Description

All

-clicensefile

Set LM_LICENSE_FILE to licensefile.It can have the form port@host.

All

-hor -help

Displaystartup options (without starting MATLAB).

All

-logfile"logfilename"

Automaticallywrite output from MATLAB to the specified log file.

Windowsplatforms

-minimize

StartMATLAB with the desktop minimized. Any desktop tools or documentsthat were undocked when MATLAB was last closed will not beminimized upon startup.

UNIXplatforms

-nojvm

StartMATLAB without loading the Sun Microsystems JVM™ software. Thisminimizes memory usage and improves initial startup speed, butrestricts functionality. With nojvm,you cannot use the desktop, figures, or any tools that requireJava software.Forexample, you cannot set preferences if you start MATLAB withthe -nojvm option.However, you can start MATLAB once without the -nojvm option,set the preference, and quit MATLAB. MATLAB remembers thatpreference when you start it again, even if you usethe-nojvm option.

All

-nosplash

StartMATLAB without displaying its splash screen.

All

-r"statement"

Automaticallyrun the specified statement immediately after MATLAB starts. Thisis sometimes referred to as calling MATLAB in batch mode. Filesyou run must be in the startup folder for MATLAB or on the searchpath. Do not include path names or file extensions. Enclose thestatement in double quotation marks ("statement").Use semicolons or commas to separate multiple statements

All

-singleCompThread

LimitMATLAB to a single computational thread. By default, Windowsmakes use of the multithreading capabilities of the computer onwhich it is running.


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.

  • Createa Perl script such as

    #!/usr/local/bin/perl $val = 10;  system('matlab -r "test(' . ${val} . ')"');
  • Invokethe Perl script at the prompt using a Perl interpreter.


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.



本文内容由 Jillian 提供

最新评论

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

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.

返回顶部