![]() There are several ways of using Scilab and the following paragraphs present three methods: using the console in the interactive mode, using the exec function against a le, using batch processing. clf //multiple plot x 0: 0.1: 2 pi ' plot (x, sin (x) sin (2 x) sin (3 x)) clf ( ) x 0 : 0.1 : 2 pi ' // axis on the right plot ( x, sin ( x ) ) a gca ( ) // Handle on current axes entity a. And finally I have plotted the Fourier Series. In this section, we make our rst steps with Scilab and present some simple tasks we can perform with the interpreter. ![]() And in the previous post I had only calculated the Fourier Coefficients, a0, A, B, but this time I am using those to calculate the Fourier Series, through the function ‘solution’. Series=series+A(i)*cos(i*%pi*x/l)+B(i)*sin(i*%pi*x/l) Īs you can notice, the code is almost the same as before, except that I have changed the name of the function from ‘fourier’ to ‘fourierplot’. If you haven’t read the last post which is being continued here then I recommend you read that first here. To have a complete plot we need to add a grid, labels for both axes, a title and a legend. The most common and easy to use function is the 2-D line plot, which is called using the embedded Sclab function plot (). With every plot() function we add, new line plots are created on the same graphic window. ![]() The default Scilab package comes with a variety of embedded function for plots. To draw multiple lines we will use different functions which are as follows: y x. I have used the same code as before and just added a few more lines of code. Dear chanyau, Since this the plot consist of multiple line segments, we cannot plot it with a single plot2d function. Scilab plot tutorial simple example (1) Data and signals are very easy to analyze in Scilab. Here we will use two lists as data with two dimensions (x and y) and at last plot the lines as different dimensions and functions over the same data. The below example present 2 line plots generated from one singe execution of the program with two different set of axes. We can also use the Fourier Coefficients to calculate the Fourier Series and then Plot the FS Approximation and compare it to the original function. Arranging multiple line plots in different subplot: Matlab supports to present the line plots generated in single execution, with distinct set of axes. In the last post I showed you guys how to calculate Fourier Coefficients for a given function defined in the range.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |