Thursday, October 18, 2012

Scilab as software for engineers

I'm an engineer (of telecommunications) and have used Scilab for several years (since 2005). There are many useful tools for image and signal processing, optimization, linear systems and transformations, and general simulations.

Scilab is a software for numerical simulation supported by Scilab Consortium. This group of companies provides resources and services for users and other companies those intend to migrate to an open and stable software platform.

Beyond formal support, Scilab Consortium is an open environment for doubts and discussions where everyone can help and be helped.

About technical resources, Scilab has two ways for developing and application or simulation: script language (Scinotes) or drag-and-drop interface (Scicos), both are powerful but I believe script language is supported by more external toolboxes.

Scilab external toolboxes are freeware and can be downloaded and installed through ATOMS tool (see next picture, click in the figure to enlarge it).

Some links for posts I have published here about my fields of study:


Scilab functions:

Fourier Transform:

Signal processing:

Image Processing:

Data visualization:



Tuesday, October 2, 2012

Plotting contours of surfaces

I know there is very useful to see contours of surfaces, many areas use this kind of resource and Scilab has a very simple way to do that.

For a first example, let's use the surface given by the function z = x² + y², this function is a 3D parable. Run the following code for making this surface's graph.

x = -5:0.1:5;
 y = -5:0.1:5;

[xx yy] = meshgrid(x, y);

z = xx.^2 + yy.^2;

plot3d(x, y, z);

The generated graph is like this.
Now, let's see the contours of that surface. But, before, it's interesting to analyze the equation z = x² + y². If z is fixed in a constant value, we have x² + y² = const and this equation means a circle centered in the point (0, 0) and radius square of const.

For plotting the contours, run this code:

n_curves = 10;
x = -5:0.1:5;
y = -5:0.1:5;

function z=my_surface(xx, yy),
z=xx^2 + yy^2;

contour(x, y, my_surface, n_curves);

The result is presented following:

In fact, we can see there are concentric circles centered in the point (0, 0).

So, that's all folks!