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 = 7.00; d = 33.48; x = [7.00, 11.00, 7.00]; x1 = [7.00 11.00; 7.00 11.00]; x2 = [7.00 11.00 7.00; 7.00 11.00 7.00; 7.00 11.00 7.00]; |
1 2 3 4 5 | a = 7.00; d = 33.48; x = { 7, 11, 7}; x1 = {{ 7, 11}, { 7, 11}}; x2 = {{ 7, 11, 7}, { 7, 11, 7}, { 7, 11, 7}}; |
1 2 3 4 5 6 7 | import numpy as np a = 7.00 d = 33.48 x = np.array([ 7, 11, 7]) x1 = np.array([[ 7, 11], [ 7, 11]]) x2 = np.array([[ 7, 11, 7], [ 7, 11, 7], [ 7, 11, 7]]) |
1 2 3 4 5 | a = 7.00 d = 33.48 x = c( 7, 11, 7) x1 = matrix(c( 7, 11, 7, 11), nrow = 2, ncol = 2, byrow = TRUE) x2 = matrix(c( 7, 11, 7, 7, 11, 7, 7, 11, 7), nrow = 3, ncol = 3, byrow = TRUE) |
1 2 3 4 5 6 7 | from sympy import * a = 7.00 d = 33.48 x = Matrix([ 7, 11, 7]) x1 = Matrix([[ 7, 11], [ 7, 11]]) x2 = Matrix([[ 7, 11, 7], [ 7, 11, 7], [ 7, 11, 7]]) |
1 2 | x = [7, 11, 7]; % This is an array x1 = [7 11; 7 11]; % This is a 2D matrix |
1 2 | x = { 7, 11, 7}; (* This is an array *) x1 = {{ 7, 11}, { 7, 11}}; (* This is a 2D matrix *) |
1 2 3 4 | import numpy as np x = np.array([ 7, 11, 7]) # This is an array x1 = np.array([[ 7, 11], [ 7, 11]]) # This is a 2D matrix |
1 2 | x = c( 7, 11, 7) # This is an array x1 = matrix(c( 7, 11, 7, 11), nrow = 2, ncol = 2, byrow = TRUE) # This is a 2D matrix |
1 2 3 4 | from sympy import * x = Matrix([ 7, 11, 7]) # This is an array x1 = Matrix([[ 7, 11], [ 7, 11]]) # This is a 2D matrix |
1 2 3 4 5 | a = 7; b = 11; d = 33.48103913; c = 0.84; xC = [0.84, 7.00, 0.84]; |
1 2 3 4 5 | a = 7; b = 11; d = 33.48103913; c = 0.84; xC = {0.84, 7.00, 0.84}; |
1 2 3 4 5 6 7 | import numpy as np a = 7 b = 11 d = 33.48103913 c = 0.84 xC = np.array([0.84, 7.00, 0.84]) |
1 2 3 4 5 | a = 7 b = 11 d = 33.48103913 c = 0.84 xC = c(0.84, 7.00, 0.84) |
1 2 3 4 5 6 7 | from sympy import * a = 7 b = 11 d = 33.48103913 c = 0.84 xC = Matrix([0.84, 7.00, 0.84]) |
1 2 3 4 5 6 7 | C = [7, 11, 7]; % The Mathematica tab adds an 'm' to the variable name D = [7 11; 7 11]; E = 11; I = 7; K = 11; N = 7; O = 11; |
1 2 3 4 5 6 7 | Cm = { 7, 11, 7}; (* The Mathematica tab adds an 'm' to the variable name *) Dm = {{ 7, 11}, { 7, 11}}; Em = 11; Im = 7; Km = 11; Nm = 7; Om = 11; |
1 2 3 4 5 6 7 8 9 | import numpy as np C = np.array([ 7, 11, 7]) # The Mathematica tab adds an 'm' to the variable name D = np.array([[ 7, 11], [ 7, 11]]) E = 11 I = 7 K = 11 N = 7 O = 11 |
1 2 3 4 5 6 7 | C = c( 7, 11, 7) # The Mathematica tab adds an 'm' to the variable name D = matrix(c( 7, 11, 7, 11), nrow = 2, ncol = 2, byrow = TRUE) E = 11 I = 7 K = 11 N = 7 O = 11 |
1 2 3 4 5 6 7 8 9 | from sympy import * C = Matrix([ 7, 11, 7]) # The Mathematica tab adds an 'm' to the variable name D = Matrix([[ 7, 11], [ 7, 11]]) E = 11 I = 7 K = 11 N = 7 O = 11 |
1 | x1 = [7 11; 7 11]; |
1 | x1 = {{ 7, 11}, { 7, 11}}; |
1 2 3 | import numpy as np x1 = np.array([[ 7, 11], [ 7, 11]]) |
1 | x1 = matrix(c( 7, 11, 7, 11), nrow = 2, ncol = 2, byrow = TRUE) |
1 2 3 | from sympy import * x1 = Matrix([[ 7, 11], [ 7, 11]]) |
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 = {{ 7, 11}, { 7, 11}}; |
1 2 3 | import numpy as np x1 = np.array([[ 7, 11], [ 7, 11]]) |
1 | x1 = matrix(c( 7, 11, 7, 11), nrow = 2, ncol = 2, byrow = TRUE) |
1 2 3 | from sympy import * x1 = Matrix([[ 7, 11], [ 7, 11]]) |
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 = 33.48103913; |
1 2 3 | import numpy as np d = 33.48103913 |
1 | d = 33.48103913 |
1 2 3 | from sympy import * d = 33.48103913 |
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([[ 7, 11], [ 7, 11]]) |
1 2 3 | from sympy import * x1 = Matrix([[ 7, 11], [ 7, 11]]) |
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 21:49:58 (CDT)
Duration:
0s
Show/Hide answer
{}