You are viewing this question as it will appear in the manual grading interface.
Return to the normal view when
you are done.
Correct answer
1 2 3 4 5 | a = 5.00; d = 37.75; x = [5.00, 9.00, 5.00]; x1 = [5.00 9.00; 5.00 9.00]; x2 = [5.00 9.00 5.00; 5.00 9.00 5.00; 5.00 9.00 5.00]; |
1 2 3 4 5 | a = 5.00; d = 37.75; x = {5, 9, 5}; x1 = {{5, 9}, {5, 9}}; x2 = {{5, 9, 5}, {5, 9, 5}, {5, 9, 5}}; |
1 2 3 4 5 6 7 | import numpy as np a = 5.00 d = 37.75 x = np.array([5, 9, 5]) x1 = np.array([[5, 9], [5, 9]]) x2 = np.array([[5, 9, 5], [5, 9, 5], [5, 9, 5]]) |
1 2 3 4 5 | a = 5.00 d = 37.75 x = c(5, 9, 5) x1 = matrix(c(5, 9, 5, 9), nrow = 2, ncol = 2, byrow = TRUE) x2 = matrix(c(5, 9, 5, 5, 9, 5, 5, 9, 5), nrow = 3, ncol = 3, byrow = TRUE) |
1 2 3 4 5 6 7 | from sympy import * a = 5.00 d = 37.75 x = Matrix([5, 9, 5]) x1 = Matrix([[5, 9], [5, 9]]) x2 = Matrix([[5, 9, 5], [5, 9, 5], [5, 9, 5]]) |
1 2 | x = [5, 9, 5]; % This is an array x1 = [5 9; 5 9]; % This is a 2D matrix |
1 2 | x = {5, 9, 5}; (* This is an array *) x1 = {{5, 9}, {5, 9}}; (* This is a 2D matrix *) |
1 2 3 4 | import numpy as np x = np.array([5, 9, 5]) # This is an array x1 = np.array([[5, 9], [5, 9]]) # This is a 2D matrix |
1 2 | x = c(5, 9, 5) # This is an array x1 = matrix(c(5, 9, 5, 9), nrow = 2, ncol = 2, byrow = TRUE) # This is a 2D matrix |
1 2 3 4 | from sympy import * x = Matrix([5, 9, 5]) # This is an array x1 = Matrix([[5, 9], [5, 9]]) # This is a 2D matrix |
1 2 3 4 5 | a = 5; b = 9; d = 37.75189198; c = 0.88; xC = [0.88, 5.00, 0.88]; |
1 2 3 4 5 | a = 5; b = 9; d = 37.75189198; c = 0.88; xC = {0.88, 5.00, 0.88}; |
1 2 3 4 5 6 7 | import numpy as np a = 5 b = 9 d = 37.75189198 c = 0.88 xC = np.array([0.88, 5.00, 0.88]) |
1 2 3 4 5 | a = 5 b = 9 d = 37.75189198 c = 0.88 xC = c(0.88, 5.00, 0.88) |
1 2 3 4 5 6 7 | from sympy import * a = 5 b = 9 d = 37.75189198 c = 0.88 xC = Matrix([0.88, 5.00, 0.88]) |
1 2 3 4 5 6 7 | C = [5, 9, 5]; % The Mathematica tab adds an 'm' to the variable name D = [5 9; 5 9]; E = 9; I = 5; K = 9; N = 5; O = 9; |
1 2 3 4 5 6 7 | Cm = {5, 9, 5}; (* The Mathematica tab adds an 'm' to the variable name *) Dm = {{5, 9}, {5, 9}}; Em = 9; Im = 5; Km = 9; Nm = 5; Om = 9; |
1 2 3 4 5 6 7 8 9 | import numpy as np C = np.array([5, 9, 5]) # The Mathematica tab adds an 'm' to the variable name D = np.array([[5, 9], [5, 9]]) E = 9 I = 5 K = 9 N = 5 O = 9 |
1 2 3 4 5 6 7 | C = c(5, 9, 5) # The Mathematica tab adds an 'm' to the variable name D = matrix(c(5, 9, 5, 9), nrow = 2, ncol = 2, byrow = TRUE) E = 9 I = 5 K = 9 N = 5 O = 9 |
1 2 3 4 5 6 7 8 9 | from sympy import * C = Matrix([5, 9, 5]) # The Mathematica tab adds an 'm' to the variable name D = Matrix([[5, 9], [5, 9]]) E = 9 I = 5 K = 9 N = 5 O = 9 |
1 | x1 = [5 9; 5 9]; |
1 | x1 = {{5, 9}, {5, 9}}; |
1 2 3 | import numpy as np x1 = np.array([[5, 9], [5, 9]]) |
1 | x1 = matrix(c(5, 9, 5, 9), nrow = 2, ncol = 2, byrow = TRUE) |
1 2 3 | from sympy import * x1 = Matrix([[5, 9], [5, 9]]) |
All computational languages are displayed by default. These can be turned off using the
element attributes show-matlab, show-mathematica,
show-numpy, and show-r. In this example, we remove the the Matlab
tab. The default active tab will be the first one in the list, in this case: Mathematica.
1 | x1 = {{5, 9}, {5, 9}}; |
1 2 3 | import numpy as np x1 = np.array([[5, 9], [5, 9]]) |
1 | x1 = matrix(c(5, 9, 5, 9), nrow = 2, ncol = 2, byrow = TRUE) |
1 2 3 | from sympy import * x1 = Matrix([[5, 9], [5, 9]]) |
When a tab is not displayed, the default active tab can still be set. In this case, the Mathematica tab is hidden and NumPy is set as the default active tab.
1 | d = 37.75189198; |
1 2 3 | import numpy as np d = 37.75189198 |
1 | d = 37.75189198 |
1 2 3 | from sympy import * d = 37.75189198 |
Any tab can be displayed alone. In this case, the Matlab, Mathematica, and R tabs are hidden and the NumPy tab is displayed alone.
1 2 3 | import numpy as np x1 = np.array([[5, 9], [5, 9]]) |
1 2 3 | from sympy import * x1 = Matrix([[5, 9], [5, 9]]) |
Student view placeholder
In student views this area is used for assessment and score info.
Tools
Staff information
Question
Title:
Element pl-variable-output: Display matrix and scalar data
Variant
Started at:
2026-08-04 23:37:49 (CDT)
Duration:
0s
Show/Hide answer
{}