Question: Please help solving Using Matlab Write a function with the header: function (Q) = myIsprime(M) Which takes a 2-D matrix M as input and returns

Please help solving Using Matlab

Please help solving Using Matlab Write a function with the header: function

Write a function with the header: function (Q) = myIsprime(M) Which takes a 2-D matrix M as input and returns a matrix Q of the same size with a 'P' in every position where M has a prime number, and an 'X' in every position where M has a non-prime number. Please use nested for-loops to cycle through members of M You may use built-in function isprime to evaluate each element of M. Test Cases: >> M = [2 15 12 6 ; 7 12 18 8 ; 5 1 9 2 ; 12 9 12 0] M = >> myIsprime (M) ans = PXXX PXXX PXXP XXXX >> M = [115 144 50 152 ; 93 142 20 53 ; 157 162 56 132 ; 34 40 43 158] M =

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!