Element pl-matrix-component-input: Input of matrices in grid format

Suppose ${\bf x}$ is the following array:

1
x = [1 2 3 4];
1
x = {{1, 2, 3, 4}};
1
2
3
import numpy as np

x = np.array([[1, 2, 3, 4]])
1
x = matrix(c(1, 2, 3, 4), nrow = 1, ncol = 4, byrow = TRUE)
1
2
3
from sympy import *

x = Matrix([[1, 2, 3, 4]])
1.

Enter the components of ${\bf x}$. The attribute allow-partial-credit="true" is used, so each correct entry receives a partial score. By default, when allow-partial-credit="true", the attribute allow-feedback is also set to true, and hence the submission panel indicates which entries are incorrect.


Suppose ${\bf A}$ is the following array:

1
A = [0.68 0.60; 0.17 0.02];
1
A = {{0.68, 0.60}, {0.17, 0.02}};
1
2
3
import numpy as np

A = np.array([[0.68, 0.60], [0.17, 0.02]])
1
A = matrix(c(0.68, 0.60, 0.17, 0.02), nrow = 2, ncol = 2, byrow = TRUE)
1
2
3
from sympy import *

A = Matrix([[0.68, 0.60], [0.17, 0.02]])
2.

Enter the components of ${\bf A}$. To get the answer correct, all entries need to be correct.

3.

Enter the components of ${\bf A}$. Here we use allow-partial-credit="true" and allow-feedback="false". Hence, each correct entry receives a partial score, but the submission panel does not indicate which entries are incorrect.

4.

This is a very long vector, it should be able to scroll. Enter the vector whose values are increasing integers in the range $1$ to $20$ (inclusive).

5.

Enter the vector $${\bf y} = \begin{bmatrix} \frac{1}{2} & \frac{1}{4} & \frac{1}{8} & \frac{1}{16} \end{bmatrix}$$ With the attribute allow-fractions="true" (which is true by default), entries can be submitted as the quotient of two decimal numbers.

6.

Enter the identity matrix. With the attribute allow-blank="true" (which is false by default), entries can be left blank to represent a zero, so you may leave the elements with a zero blank.

Correct answer

Student view placeholder

In student views this area is used for assessment and score info.
Tools

Staff information

Question

Title:
Element pl-matrix-component-input: Input of matrices in grid format

Variant

Started at:
2026-08-04 20:43:43 (CDT)
Duration:
0s
Show/Hide answer
{
  "out1": {
    "_type": "ndarray",
    "_dtype": "float64",
    "_value": [
      [
        0.68,
        0.6
      ],
      [
        0.17,
        0.02
      ]
    ]
  },
  "out2": {
    "_type": "ndarray",
    "_dtype": "float64",
    "_value": [
      [
        0.68,
        0.6
      ],
      [
        0.17,
        0.02
      ]
    ]
  },
  "out3": {
    "_type": "ndarray",
    "_dtype": "int64",
    "_value": [
      [
        1,
        2,
        3,
        4
      ]
    ]
  },
  "out4": {
    "_type": "ndarray",
    "_dtype": "int64",
    "_value": [
      [
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        12,
        13,
        14,
        15,
        16,
        17,
        18,
        19,
        20
      ]
    ]
  },
  "out5": {
    "_type": "ndarray",
    "_dtype": "float64",
    "_value": [
      [
        0.5,
        0.25,
        0.125,
        0.0625
      ]
    ]
  },
  "out6": {
    "_type": "ndarray",
    "_dtype": "int64",
    "_value": [
      [
        1,
        0,
        0
      ],
      [
        0,
        1,
        0
      ],
      [
        0,
        0,
        1
      ]
    ]
  }
}
History
dec frac
rad deg