numbas / editor

An editor for the Numbas e-learning system.
http://numbas.mathcentre.ac.uk
Apache License 2.0
59 stars 61 forks source link

Matrix won't accept expression entries #586

Closed mittkkoo closed 10 months ago

mittkkoo commented 3 years ago

I want to define a variable of type matrix, containing JME expressions. But this fails:

matrix([expression("cos(delta)")],[expression("i*sin(delta)/n")])

The error message says:

Error evaluating variable matrix_name: No definition of 'matrix' of correct type found.

Am I missing something or this is not possible?

christianp commented 3 years ago

The matrix data type can only represent matrices of real numbers. I have an open issue at numbas/Numbas#531 about making the vector and matrix types a bit more generic, but I don't know how that'll happen yet.

What do you want to do with this matrix? Is it just for display, or as an answer to a part, or do you need to do arithmetic with it?