

The common (base 10) logarithm is denoted in text by log x or log 10 x. However, this notation has not been carried over into MATLAB, which uses log (x) to represent In x. Mathematics text, In x denotes the natural logarithm, where x = eY implies thatīecause In e = I. Note that in Some common mathematical functions a a a O’i, which is the positive root. Similarly, we can type exp (2) to obtain e2 = 7.3891, where e is the base of the natural logarithms. For example, typing sqrt ( – 9 ) gives the result ans = a + 3. MATLAB automatically handles the square roots of negative numbers and returns a number with an imaginary part as the result.

To compute √9, you type short (9) at the command line: When you press Enter, you see the result ans = 3. An example is the square root function sqrt. Table 3.1-1 summarizes ‘some of the common elementary functions.
ELEMENTARY MATH FUNCTIONS IN MATLAB CODE
You can see the code and even modify it if you want. Other functions, like sinh, are implemented in M-files. If you know the correct spelling of a MATLAB function-for example, disp-you can type help disp to obtain a description of the function.Some of the functions, like sqrt and s in, are built-in, and are not M-files.They are part of the MATLAB core so they are very efficient, but the computational details are not readily accessible. Their names and brief descriptions are displayed when you type look for imaginary. Note that imaginary is not a MATLAB function, but the word is found in the help descriptions of the MATLAB function imag and the special symbols i and j. For example type lookfor imaginary to get a list of the functions that deal with imaginary numbers.

You can use the look for command to find functions that are relevant to your application.
