

This produces the contour plot presented in figure 22.įigure 22: Contour plot of the function f(x1,x2) = x1^2 + x2^2. The linspace function is used to generate vectors of data so that the function is analyzed in the range ^2.Ĭontour ( xdata, ydata, myquadratic2arg, 10) The myquadratic function takes two input arguments x1 and x2 and returns f(x1,x2) = x1^2 + x2^2. In the following Scilab session, we use a simple form of the contour function, where the function myquadratic is passed as an input argument.

The myquadratic function squares the input argument x with the ”ˆ”operator. We begin by defining the function which is to be plotted. We emphasize the use of vectorized functions, which produce matrices of data in one function call.
#SCILAB OUTPUT MATRIX HOW TO#
In this section, we present how to produce a simple x-y plot. linspaceĬonfigure the title and the legends of the current plotįigure 20: Scilab functions used when creating a plot. The functions presented in figure 20 will be used in the examples of this section. In order to get an example of a 3D plot, we can simply type the statement surf() in the Scilab console.ĭuring the creation of a plot, we use several functions in order to create the data or to configure the plot. The most commonly used plot functions are presented in figure 19. It can create x-y plots with the plot function, contour plots with the contour function, 3D plots with the surf function, histograms with the histplot function and many other types of plots. Scilab can produce many types of 2D and 3D plots. We finally export the plots so that we can use it in a report. Then we customize the title and the legend of our graphics. In this section, we present how to create 2D plots and contour plots. Scilab offers many ways to create and customize various types of plots and charts. Producing plots and graphics is a very common task for analysing data and creating reports.
