Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 19Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started