From: joseph Frank on 2 Jun 2010 17:41 if A is a cell array and has a nan in it how can I find this nan?
From: Walter Roberson on 2 Jun 2010 17:49 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 2 Jun 2010 18:09 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 2 Jun 2010 18:22 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 2 Jun 2010 18:34
SampleAll 478x221 array. it si a mix of nan,numbers and strings but the third column is only numbers and nans |