Set Matrix Values

This command is in the Matrix menu. It allows to fill in a matrix with the results of a function z=f(i,j) in which i and j are the row and column numbers.

You can use the X-values and Y-values defined with the Set Dimensions... command command, and also define your functions based on the x and y variables.

The functions can be written on several lines, and the intrinsic functions which are available are listed in the appendix .

Figure 5-58. The Set Values... dialog for matrix.

Using Python as scripting engine for the calculation of matrix values has the drawback that even if it allows a more powerfull synthax, it can be quite slow for large matrices. Therefore you have the possibility to use muParser instead, even if Python is set as the default script engine for your QtiPlot project, by checking the box Use built-in muParser. Warning: muParser is very fast for the evaluation of single line expressions only, therefore try to avoid a synthax like:


    a = cell(1, 1)

    b = cell(2, 2)

    a*b*x + b*x*x + a

and prefer the following one:

    cell(1, 1)*cell(2, 2)*x + cell(2, 2)*x*x + cell(1, 1)

which will highly increase the speed of the evaluation!