Question: Write a function with the header: function [out] = myDataTypeChecker(A,B) takes two matrices A and B and has the following behavior (in this order): 1)

Write a function with the header:

 function [out] = myDataTypeChecker(A,B) 

takes two matrices A and B and has the following behavior (in this order):

  1. 1) if either A or B contains a Not a Number, the function should return -1.

  2. 2) if either A or B contains an +/-Infinity, the function should return -2

  3. 3) if either A or B is a character array, the function should return -3

  4. 4) if both A and B are logical arrays, the function should check to see if A and B

    are the same size.

    1. If they are not, it should return -4

    2. If they are, it should return the AND of A and B (an array indicating where

      both A and B are true)

  5. 5) if both A and B are numeric arrays, the function should check to see if A and B

    are the same size.

    1. If they are not, it should return -5

    2. If they are, it should return an array of the absolute value of the difference

      of A and B.

  6. 6) If A and B are not both logical arrays or not both numeric arrays,, it should return

    -6;

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!