Introduction to Matlab

Mathematics University of Queensland Mathematics

3  Help in Matlab

There are three ways to get help in Matlab.

3.1  The Help Command

This is the easiest way to find out more about specific Matlab commands. If you have forgotten small details, for example. The command help < name > gives information about the Matlab command < name > .

help sin     % Information about sin.
help i       % Information about  i .
help log     % This is enough information about log
             %     to show  log  means log to the base  e .
why          %  Provides general answers.

By itself, the command help gives a list of topics in Matlab. Initially, many of the topics will be mysterious. The most familiar topic from the list is probably `elementary functions'. To explore this topic use the command help elfun. In the most recent versions of Matlab the lookfor command can also be used to search for relevant information.

help           %  Gives a list topics.
help elfun     %  More help in the area `elfun', i.e.
               %    elementary functions like sin, exp,..
help sign      %  Information about a new command
               %     from the list in 'elfun'
lookfor logarithm  %  Gives the name of some
                   %     functions related to logarithms
lookfor legend     %  Finds former students

The lookfor command is quite useful; however it may be very slow in the Mathematics PC lab. This is due to the heavy network traffic. But lookfor should be quite fast on a single user PC.

3.2  The Help Window

It is also possible to get help by clicking on the `Help' menu above the command window. From the `Help' menu, select the `Help Window' item (by clicking) and the list of help topics is displayed. The advantage of this method is that it is possible to navigate around various topics by double clicking on them. For example, in the help window double click on elfun to find the same information given by the help elfun command. This is a good way to explore Matlab's commands.

3.3  The Help Desk

Matlab also comes with help documentation that can be read by Web browsers. This may be used by

After a slight pause the initial documentation window should come up. Interesting links to pursue are:-

Exercise 4

   

  1. Is the inverse sine function one of Matlab's elementary functions? (The inverse sine is also known as sin-1, arcsin, or asin.)

    1. How do you find sin-1(.5) in Matlab? Use help to find out.

    2. If x = .5, is sin(sin-1(x))-x exactly zero in Matlab?

    3. If q = p/3, is sin-1(sin(q))-q exactly zeros in Matlab? What about q = 5p/11?

  2. Does Matlab have a specialized Mathematical function to calculate the greatest common divisor? (Use help or lookfor)

    1. Use Matlab to find the greatest common divisor of 30 and 24. (Check the answer the same as the answer calculated manually.)

    2. What is the greatest common divisor of 3072 and 288?

  3. Does Matlab have a function to convert numbers to base 16, i.e. to hexadecimal form? (Hint: Use lookfor to find a way to convert a decimal number to hexadecimal.) What is 61453 in base 16? Computers almost always represent numbers internally as hexadecimals.

  4. Use the search box in the Help Desk and look for information about logarithms. There are 9 entries, including the last command, logm, for calculating the log of a matrix!

To wind down, type the Matlab command demo. This brings a menu of demonstrations and examples to explore.

  1. Visit the Gallery to see a number of attractive images.

  2. Visit the Games section. Some find the game bubble wrap to be extraordinarily relaxing.