From: joseph Frank on
if A is a cell array and has a nan in it how can I find this nan?
From: Walter Roberson on
joseph Frank wrote:
> if A is a cell array and has a nan in it how can I find this nan?

cellfun(@(V) any(isnan(V(:))), A)

That will be true for any position in A in which there is a nan in the first
level of that cell.

But perhaps you meant you needed to know the index (J,K,L,M...) within A, and
you needed to know the index (P,Q,R...) within the cell A{J,K,L,M...} ?

Or perhaps you meant that A{J} might contain a mix of objects (perhaps
including calls and structures) one of which contains a nan somewhere, and you
need to know which member of A that is the case for? Or perhaps you need exact
cell indices and structure indices and field names and so on -- everything you
would need to know in order to reference the name ?

Or perhaps...
From: joseph Frank on
for sure thanks but I am still receiving an error:

X=SampleAll(:,3);
f=cellfun(@(V) any(isnan(V(:))), X)

is giving:

Error in ==> @(V)any(isnan(V(:)))


Error in ==> Step1BuildingtheRegressionVariables at 32
f=cellfun(@(V) any(isnan(V(:))), X)
From: Walter Roberson on
joseph Frank wrote:
> for sure thanks but I am still receiving an error:
>
> X=SampleAll(:,3);
> f=cellfun(@(V) any(isnan(V(:))), X)
>
> is giving:
>
> Error in ==> @(V)any(isnan(V(:)))
>
>
> Error in ==> Step1BuildingtheRegressionVariables at 32
> f=cellfun(@(V) any(isnan(V(:))), X)

What error is it giving?

Is SampleAll a cell array? What type and shape are typical contents?
From: joseph Frank on
SampleAll 478x221 array. it si a mix of nan,numbers and strings but the third column is only numbers and nans