Question: In R: (25 points) Write a function Tran() which input a matrix X as an argument, and output a new matrix Y based on the
In R: 
(25 points) Write a function Tran() which input a matrix X as an argument, and output a new matrix Y based on the rule: If an element of X is an even number, Y keeps the same value; if an element of X is a odd number, Y doubles it. For example: 5 4 9 X = 14 3 6 2 8 23 10 4 18 Y = 4 6 6 2 8 46 a) Call the Tran() function you created to transform the following matrix TT. Print the output. [10 11 66 TT = 57 18 35 1 35 19
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
