Set Matrix Values

This command is located in the Matrix menu. It allows filling in a matrix with the results of evaluating 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.

Functions can span several lines. The available intrinsic functions are listed in the muParser section of the Mathematical Expressions and Scripting chapter.

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

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

	a = cell(1, 1)
	b = cell(2, 2)
	a*b*x + b*x*x + a
in preference for something like the following:

	cell(1, 1)*cell(2, 2)*x + cell(2, 2)*x*x + cell(1, 1)
which will greatly increase the speed of evaluation!