brainsbrazerzkidai.blogg.se

Scilab output matrix
Scilab output matrix













scilab output matrix

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.

  • nz the level values or the number of levels.
  • z is a real matrix of size (n1,n2), containing the values of the function or a Scilab function which defines the surface z=f(x,y),.
  • The contour function has the following syntax The Scilab function contour plots contours of a function f. This type of graphic is often used in the context of numerical optimization because it draws functions of two variables in a way that shows the location of the optimum. In this section, we present the contour plots of a multivariate function and make use of the contour function. When the number of points to manage is large, using functions directly saves significant amount of memory space, since it avoids generating the intermediate vector ydata. Indeed, the second input argument of the plot function can be a function, as in the following session. Notice that we could have produced the same plot without generating the intermediate array ydata. We finally use the plot function so that the data is displayed as an x-y plot.įigure 21 presents the associated x-y plot. This produces the row vector ydata, which contains 50 entries. We can pass it to the myquadratic function and get the function value at the given points. The xdata variable now contains a row vector with 50 entries, where the first value is equal to 1 and the last value is equal to 10. We can use the linspace function in order to produce 50 values in the interval.

    scilab output matrix

    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.















    Scilab output matrix