Answer only in R coding language, please. Thank you Q1. Write a function margin_index_power() that takes as input a matr

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Answer only in R coding language, please. Thank you Q1. Write a function margin_index_power() that takes as input a matr

Post by answerhappygod »

Answer only in R coding language, please. Thank you
Q1. Write a function margin_index_power() that takes as input a
matrix A and an argument rows, TRUE/FALSE with a default value of
TRUE. margin_index_power(A, rows = TRUE) outputs the matrix A with
the elements in the ith row of A taken to the ith power. If rows =
FALSE, then do the same but with the columns instead of rows of
A.
Please test your function on the following test inputs in your
submission:
Q2.
Write a function is_anti_diagonal() that takes as
input a matrix A and outputs TRUE if it is
anti-diagonal and FALSE otherwise. While you can
assume A is a matrix, you cannot assume that it is
square.
Q3.
Write a function called set_border_NA() that takes as
input a matrix A and outputs A with its borders
set to NA. If A has exactly one row or exactly one
column, throw an error of your choosing.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply