MATLAB用户可以在命令窗口中直接输入命令来获得相关的帮助信息,这种获取方式比联机帮助更为快捷。在命令窗口中获取帮助信息的主要命令为help、lookfor以及模糊寻找,下面将介绍这些命令。
直接输入help命令,会显示当前的帮助系统中所包含的所有项目。需要注意的是,用户在输入该命令后,命令窗口只显示当前搜索路径中的所有目录名称。例如:
>>help
HELP topics:
help
HELP topics:
MATLABhdlcoder\MATLABhdlcoder - (No table of contents file)
MATLABxl\MATLABxl -MATLABBuilderEX
MATLAB\demos -Examples.
MATLAB\graph2d -Two dimensional graphs.
MATLAB\graph3d -Three dimensional graphs.
MATLAB\graphics -HandleGraphics.
MATLAB\plottools -Graphical plot editing tools
MATLAB\scribe -Annotation andPlotEditing.
MATLAB\specgraph -Specialized graphs
…… ……
vnt\vntguis - (No tableof contents file)
vnt\vntdemos - (No tableof contents file)
vntblks\vntblks - (No table of contents file)
vntblks\vntmasks - (No table of contents file)
wavelet\wavelet -WaveletToolbox
wavelet\wmultisig1d - (No table of contents file)
wavelet\wavedemo - (No table of contents file)
wavelet\compression - (No table of contents file)
xpc\xpc - xPCTarget
xpcblocks\thirdpartydrivers - (No table of contents file)
build\xpcblocks - xPCTarget --Blocks
build\xpcobsolete - (No table of contents file)
xpc\xpcdemos - xPCTarget -- examples and sample script files.
如果用户知道某个函数名称,并想了解该函数的具体用法,则只需在命令窗口中输入help+函数名。例如:
>>help sin
sin Sine of argument in radians.
sin(X) is the sine of the elements of X.
See also asin, sind.
Overloaded methods:
codistributed/sin
gpuArray/sin
Reference page in Help browser
doc sin
当用户不知道一些函数的确切名称时,help函数就无能为力了,这时可以使用lookfor函数解决这个问题。
在使用 lookfor 函数时,用户只需知道某个函数的部分关键字,在命令窗口中输入lookfor+关键字,就可以很方便地实现查找。例如:
>>lookfor sin
sin
BioIndexedFile - class allows random read access to text files using an index file.
loopswitch -Create switch foropening and closing feedback loops.
mbcinline - replacement versionof inline using anonymous functions
cgslblock -Constructor for calibrationGenerationSimulink blockparsingmanager
xregaxesinput -Constructor for the axes input object for aListCtrl
ExhaustiveSearcher -Neighbor search object using exhaustive search.
KDTreeSearcher -Neighbor search object using a kd-tree.
…… ……
sample_supported -<name>_supported fills in a single instance or an array
dxpcUDP1 -Target toHostTransmission usingUDP
dxpcUDP2 -Target toTargetTransmission usingUDP
j1939exampleDemo - J1939 -UsingTransportProtocol
scscopedemo -SignalTracingUsingScopeTriggering
scsignaldemo -SignalTracingUsingSignalTriggering
scsoftwaredemo -SignalTracingUsingSoftwareTriggering
MATLAB 还提供一种模糊寻找的命令查询方法,只需在命令界面输入命令的前几个字母,然后按Tab键,系统便会列出所有以其开头的命令。例如,在命令窗口中输入“co”,然后按Tab键,运行结果如图1-11所示。
图1-11 模糊寻找结果