Is this allowed? If no, why not? If yes, what is the result?
No, elementwise operations for the combination of an array and a scalar operand are not defined for addition.
Is this allowed? If no, why not? If yes, what is the result?
No, elementwise operations for the combination of an array and a scalar operand are not defined for subtraction.
Is this allowed? If no, why not? If yes, what is the result?
Oh yes! The result is {22, 28, 24}.
Write a class that multiplies two matrices using the multiplication operator for matrices.
Take a look at a value:
Is this allowed? If no,why not? If yes,what is the result?
The result of mult1 is 4.
The result of mult1 is {8, 8}.
The result of mult1 is {{4, 4}, {4, 4}}.
The result of mult1 is {84}.
Is this allowed? If yes, what is the result?
Oh yes! The result is {4, 3.5, 2.5, 4.25, 3}.
Is this allowed? If yes, what is the result?
No. Elementwise operations for dividing a scalar operand with an array is not defined for division.
How would you write {{1, 3}, {4, 5}}^2 in Modelica? Write the expression in a class. What is the result?
The result is {{13, 18}, {24, 37}}.