Making a function


Prob 4A

Intialize two matrices A and B on the command window. Make a function named matrix(A, B) in which calculate the product A * B and show the result. If the two matrices can not be multiplied, dsiplay some warning statement using function size().

Prob 4B

There are initialized regular matrices A and B, and positive value n on Command window. Then, make a function func(A, B, n) in which if n = 1, then the product A * B is calculated, and otherwise, the sum A + B is, then return the result matrix as an outpu argument.

If n is negative, show some warning statement.