Need NaNs in data but not to be evaluated and keep then put back

2 vues (au cours des 30 derniers jours)
Sasha K
Sasha K le 6 Mar 2015
Commenté : Sasha K le 7 Mar 2015
I have snippet of my matrix: [NaN NaN 6.67 NaN NaN NaN NaN NaN NaN NaN 5.49 NaN NaN 6.5 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 5.31 6.85]
[data] = xlsread('datafile');
set = (data(:,2));
DO = ((set)- min(set)) / ( max(set) - min(set) );
DO(isnan(DO)) = [];
fis = readfis('Group1');
Group_1=evalfis([DO],fis);
I am using FIS to analyze the data and I need to keep the NaNs. My final result uses multiple inputs from different parameters for final output. Some sections I have missing parameters. The formula is supposed to provide analysis answer regardless of missing information. FIS substitutes default answers for NaNs. I need to graph this outcome at the end.
So, how can I ask in a coding method for analysis of just the values and not NaNs, but keep the NaNs in the end as matrix integrity. Sort of like here are the values analyse them only and put back into correct place?
Thanks!

Réponses (1)

James Tursa
James Tursa le 6 Mar 2015
Modifié(e) : James Tursa le 6 Mar 2015
Keep track of the isnan locations, and use that to put the results in the proper element locations. E.g., assuming Group_1 is the same size as DO (is this true?)
DO = ((set)- min(set)) / ( max(set) - min(set) );
ix = isnan(DO); % Remember the isnan locations
DN = DO; % Remember the full array
DO(ix) = []; % Get rid of the NaN's in DO
fis = readfis('Group1');
Group_1=evalfis([DO],fis); % Call the function for the non-NaN's
DN(~ix) = Group_1; % Put the results back into the full array
  1 commentaire
Sasha K
Sasha K le 7 Mar 2015
James thank you!
It isn't quite what I need. Is there a way like a "loop" command that asks FIS to just take the matrix size as is, but not evaluate the NaNs? Keep the size integrity the same?
Sort of going into FIS as 34 x 1 and evaluated the values only, without NaNs, directly? Kind of telling the FIS to ignore the NaNs.
Sorry if it was unclear before.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Fuzzy Logic Toolbox dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by