Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Programming Langauge: MATLAB Write a function with the header: function Q = myTrigFunction (M) which takes a Matrix M filled with integers and returns a
Programming Langauge: MATLAB
Write a function with the header: function Q = myTrigFunction (M) which takes a Matrix M filled with integers and returns a matrix Q such that 0(i,j) = sin (pi/M ( i, j )) + 1 0(i,j) = cos (pi/M ( i, j ) ) -1 if M(i,j) is an odd integer and if M(i,j) is an even integer. You may assume elements of M will be greater than 0. Test Cases: >> A= [3 4; 6 7]; >> R = myTrigFunction(A) 1.8660 0.1340 0.2929 1.4339 >>B=[41 3 5 8 12 16 1 106 9; 2 5 12 3 14 17 33 19 11]; >> S = myTrigFunction (B) 1.0765 1.8660 1.5878 0.0761 0.0341 0.0192 1.0000 0.0004 1.3420 1.0000 1.5878 0.0341 1.8660 0.0251 1.1837 1.0951 1.1646 1.2817
Step 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