Write a function with the following header function upper ca
Write a function with the following header: function [upper case, lower case, numbers, speciall my cell extractor(array) where array is a 1-n cell array. Each element of array is either A non-empty row vector of class double A non-empty row vector of class char (i.e. a non-empty character string). A non-empty cell array that follows the same format as array. upper case is a non-empty row vector of class char that contains all the upper case characters found in the elements of the input parameter array, in the order in which they appear in array. lower case is a non-empty row vector of class char that contains all the lower case characters found in the elements of the input parameter array, in the order in which they appear in array. numbers is a non-empty row vector of class double that contains all the elements of class double (except for NaN nf, and Inf found in the elements of the input parameter array, in the order in which they appear in array. special is a non-empty row vector of class double that contains all the elements of class double among NaN, nf, and Inf, that are found in the elements of the input parameter array, in the order in which they appear in array. Treat lower case letters from a to z as lower case characters, and any other character as upper case. You can assume that you will ndin array: At least one lower case character and At least one upper case character; and At least one element of class double that is not NaN, -Inf, or Inf and At least one element of class double that is one of NaN, -nf, and Inf In other words, none of your function\'s outputs should be an empty array Hints You may want to consider using recursion for this question If the variable Ac\" is a 1-1 array of class char i e. a character string that contains only one character, you can check whether this character qual es as upper case for this question by using the logical expression c upper(c). This logical expression will evaluate to true (logical 1) if the character should be considered upper case, and false (logical o) otherwise. Test cases: [u n, sl my cell extractor (4, NaN, 6, o, a\',-1, B an 460-1 NaN
Solution
function [upper_case,lower_case,numbers,special]= mycell_Extractor(array)
upper_case = [];
lower_case = [];
numbers = [];
special = [];
for i = 1:numel(array)
value = array(i){1};
if(isinf(value))
special = [special value];
elseif(isa(value,\'numeric\'))
numbers = [numbers value];
elseif(isa(value,\'char\'))
if(value==upper(value))
upper_case = [upper_case value];
else
lower_case = [lower_case value];
end
elseif(isnan(value))
special = [special value];
end
end
end
[u,l,n,s] = mycell_Extractor({1,2,\'S\',-4,\'s\',\'A\',\'a\',Inf})
