numbas / Numbas

A completely browser-based e-assessment/e-learning system, with an emphasis on mathematics
http://www.numbas.org.uk
Apache License 2.0
202 stars 117 forks source link

Element-wise operations for vectors and matrices #817

Open christianp opened 3 years ago

christianp commented 3 years ago

I was sure I already had an issue for this, but I can't find it!

It would be nice to have operators to do element-wise multiplication of vectors and matrices (and other ordered collection types?)

MATLAB puts a dot before the symbols to mark the operation as element-wise, e.g. A .* B computes the matrix with elements a_ij * b_ij. I'd like to follow this convention, but I don't know if that would cause any problems with the existing syntax.