README (not visible to students)
This question provides two matrices as both NumPy and MATLAB variables using the <pl-variable-output> element. The entries of the matrices are randomly generated. Students are asked to compute the product of these two matrices, and provide their answer using either NumPy or MATLAB format. The generated matrices are converted to JSON format with pl.to_json(...) for storage in data["params"] and data["correct_answers"].
Correct answer
$AB=$
[-1.06 -0.450 0.200 -0.820; 0.670 -0.820 0.0800 -1.51; 0.140 1.02 0.0400 0.420; 0.390 -0.800 0.170 -0.480]
$AB=$
[[-1.06, -0.450, 0.200, -0.820], [0.670, -0.820, 0.0800, -1.51], [0.140, 1.02, 0.0400, 0.420], [0.390, -0.800, 0.170, -0.480]]
Student view placeholder
Staff information
Question
Variant
Show/Hide answer
{
"C": {
"_type": "ndarray",
"_dtype": "float64",
"_value": [
[
-1.06,
-0.4500000000000001,
0.19999999999999998,
-0.82
],
[
0.67,
-0.8200000000000001,
0.07999999999999997,
-1.51
],
[
0.1399999999999999,
1.02,
0.04000000000000001,
0.42
],
[
0.39,
-0.8,
0.17,
-0.48000000000000004
]
]
}
}