![](http://images-20200215.ebookreading.net/23/1/1/9781482247336/9781482247336__a-computational-introduction__9781482247336__bg204.png)
498 A Computational Introduction to Digital Image Processing, Second Edition
A.6 Online Help
A vast amount of online help and information is available. So much, in fact, that it
is quite easy to use MATLAB or Octave without a manual. To obtain information on a
particular command, you can use
help
. For example:
MATLAB/Octave
>> help for
FOR Repeat statements a specific number of times.
The general form of a FOR statement is:
FOR variable = expr, statement, ..., statement END
The columns of the expression are stored one at a time in
the variable and then the following statements, up to the
END, are executed. The expression is often of the form X:Y,
in which case its columns are simply scalars. Some examples
(assume N has already been assigned a value).
FOR I = 1:N,
FOR J = 1:N,
A(I,J) = 1/(I+J-1);
END
END
FOR S = 1.0: -0.1: 0.0, END steps S with increments of -0.1
FOR E = EYE(N), ... END sets E to the unit N-vectors.
Long loops are more memory efficient when the colon expression appears
in the FOR statement since the index vector is never created.
The BREAK statement can be used to terminate the loop prematurely.
See also IF, WHILE, SWITCH, BREAK, END.
If there is too much information, it may scroll past you too fast to see. In such cases, you
can turn on the MATLAB pager with the command
MATLAB/Octave
>> more on
For more help on help, try:
MATLAB/Octave
>> help help
Better formatted help can be obtained with the doc function, that opens up a help browser
which interprets HTML-formatted help files. The result of the command
MATLAB/Octave
>> doc help