F.7Numerical methods 355
If a function evaluates only one number, vector, matrix, character string,
entity or object, then the function statement and corresponding function can
be simplified to:
function evaluate = pindos (input1, input2,...)
return
An example of a simple function residing in the function filebajanakis.mis:
function bname = bajanakis(isel)
if(isel == 1)
bname = ’sehoon’;
elseif(isel == 2)
bname = ’phaethon’;
else
bname = ’alkiviadis’;
end
return
F.7 Numericalmethods..........................
Matlabincludes a general-purpose numerical methods library whose functions
perform numerical linear algebra, solve algebraic equations, carry out function
differentiation and integration, solve differential equations, and execute a vari-
ety of other tasks. Special-purpose libraries of interest to a particular discipline
are accommodated intoolboxes.
Table F.7.1 shows selectedMatlabnumerical methods functions. While
these functions are generally robust and reliable, it is wise to always work under
the premises of the Arabic proverb: “Trust in Allah but always tie your camel.”
F.8 Matlabgraphics...........................
A powerful feature ofMatlabis the ability to produce professional graphics,
including animation. Graphics are displayed in dedicated windows appearing
in response to the graphics commands.
Graphics functions are listed in Tables F.8.1. in several categories. To
obtain a detailed description of a graphics function, use thehelpfacility. Some
useful tips are: