MATLAB: Plz explain the operation

cellfunxlxread

[~, ~, raw] = xlsread('C:\Users\KARTHIK P K\Desktop\kpk.xls','MT1_PMUtest_RealTimePass','E3:AQ1014');
raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''};
Explain the operation of the above statements plz

Best Answer

CELLFUN is called with two arguments: an anonymous function, and a cell array. It applies the anonymous function to each element of the cell array, and outputs an array of the same size as the cell array, whose elements are the function output. The function that you are using takes one argument, locally named x, and returns a logical AND operation (with shortcut) between all test functions that are listed: not ISEMPTY, ISNUMERIC, and ISNAN.
The output of CELLFUN is therefore an array of logicals, that is used to index the cell array raw. Elements of raw targeted by this operation are replaced with a cell that contains an empty string.