@problem@
	@config@
		matlab = true
		keepfloat=true
	@;config@
	@problemtype@
		embedded
	@;problemtype@
	@name@
		tutorial_17_matlab_continued
	@endname@
	@preamble@
		x = randfloat(0,2,3)
		mlset("a", x)
		@matlab@
			b = sin(a*pi)
			c = cos(a*pi)
			A = eye(2)
		@;matlab@
		y, z, X = mlget("b", "c", "A")
	@;preamble@
	@content@
		In order to "exchange" variable values between Matlab and the (Python) context of .xmu files, you can also use the 'mlset' and 'mlget' functions as shown in the above preamble. Here, the Matlab workspace variable 'a' is first set to the value of the .xmu-internal variable 'x'. After some computations in Matlab, the values of the workspace variables 'b', 'c' and 'A' are assigned to the variables 'y', 'z' and 'A', respectively, which can then be used within the problem content as usual. The Matlab matrix 'A', in particular, is converted to a "list of lists" stored in the Python variable 'X', which can be accessed as follows:
		\[
			X = \begin{pmatrix}
				@X[0][0]@ & @X[0][1]@ \\
				@X[1][0]@ & @X[1][1]@
			\end{pmatrix}
			\qquad\text{is the identity matrix.}
		\]
		Of course, the variables 'y', 'z' and 'A' can also be used directly for answer field definitions, as in the following problem.
		@pb;@
		Let $x=@x@$. Compute $y=\sin(x\cdot\pi)$ and $z=\cos(x\cdot\pi)$.
		@lb;@
		$y=$ @numericalans(35, y)@
		@lb;@
		$z=$ @numericalans(35, z)@
	@;content@
@;problem@