To start with a simple one, let's find the square root of 3 using Octave: Appears very simple, right?

If you wish to manipulate with matrices, you can do that in Octave. You can enter the elements of the-Matrix A in the manner elucidated in. While building (or making) simulations, you may need to have random values for checking. You can do that by using the rand command followed by the number of rows and columns as shown in. Another fact is t11at you can use many of your C commands in Octave, of which the following is a simple example:

And further, Octave has many built-in, loadable and mapping functions, function files, etc, for advanced tools. This is quite akin to the style we followed in shell programming. The firstline invokes the interpreter. (Please note that if you use a different version, you need to change the interpreter name, unlike in shell programming).

Name:  Some trials with Octave.jpg
Views: 133
Size:  40.7 KB

Octave has many in-built mathematical conversion tools. The following code shows that you can easily convert numbers from decimal to binary or hexadecimal: And there are many other in-built functions like tolower:

Another category is built-in variables (for example, hisiory..file). You can get the details by issuing the corresponding command: Just like in shell, you can have user-defined functions as shown below:

Let us move on to sOrt1.ething more complicated. If we wish to plot a function with respect to a variable by taking many parameters, it may seem a tedious task. But it is quite easy in Octave_ You get the resultant graph as shown in Figure 5.
You can use other tools like clearploi, shg, closeplot, etc, for better results and to define it completely. You can also draw different types of graphs like histograms, bar graphs, pie-charts, etc, in Octave.

You can also find functions to perform computational tasks in other fields in mathematics. For example, in case we have functions like conj (z), imag (z), Teal (Z), etc with complex numbers.