africanqert.blogg.se

Scilab matrix
Scilab matrix











scilab matrix

In Scilab a matrix can contain scalars (real, integer, complex, boolean), strings or polynomials. In fact Scilab treats also the vectors as matrices, it makes no difference from the manipulation point of view.Ī matrix is characterised by its content and by its dimension. If the matrix has only one column or one row it is called a vector. If the string variable contains the quotes characters, simple or double: ->str3 = "String ""ABC"" in double quotes"Ī matrix is an array of values arranged in rows and columns. In order to define in Scilab a string variables we must use quotes or double quotes : ->str1 = 'w' Any of the ASCII characters can be used as values for string variables. In Scilab, the variables of type string stores a character or a set of characters (words). Example with “x” being the unknown: ->p=poly(,"x","coeffs") In this case the function will be called with these arguments: poly(, arg2, “coeffs”).

scilab matrix

By supplying the coefficients of the polynomial. Example with “x” being the unknown: ->p=poly(,"x","roots")Ģ. In this case the function will be called with these arguments: poly(, arg2, “roots”). By supplying the roots of the polynomial. With this function we can define a polynomial in two ways:ġ. In Scilab, in order to define a polynomial, we have to use the poly(arg1,arg2,arg3) function. In fact a Scilab variable defined as a polynomial contains variables (unknowns or indeterminate) and constant numbers. Here is an example of a polynomial: \[ \beginĪ variable form a mathematical polynomial is not the same thing as a Scilab variable. The allowed operations within a polynomial are additions, subtractions, multiplications and positive integer exponents. A purelly imaginary complex number is defined like this: ->c = 5*%iĪ polynomial is defined as an mathematical expression of determined length which contains operations between variables and constants (coefficients). This way we’ve defined a complex number c which has the real part 2 and the imaginary part 3i. In Scilab we define the complex numbers by using the special constant %i, in the following manner: ->c = 2 + 3*%i Also, if the real number ( b) is zero, the complex number becomes a real number. If the real number (a) is zero, the complex number is purely imaginary. Image: Graphical representation of complex numbers













Scilab matrix