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) if either A or B contains a Not a Number, the function should return -1.
-
2) if either A or B contains an +/-Infinity, the function should return -2
-
3) if either A or B is a character array, the function should return -3
-
4) if both A and B are logical arrays, the function should check to see if A and B
are the same size.
-
If they are not, it should return -4
-
If they are, it should return the AND of A and B (an array indicating where
both A and B are true)
-
-
5) if both A and B are numeric arrays, the function should check to see if A and B
are the same size.
-
If they are not, it should return -5
-
If they are, it should return an array of the absolute value of the difference
of A and B.
-
-
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
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