Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
Sasha K
Sasha K am 6 Mär. 2015
Kommentiert: Sasha K am 7 Mär. 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!

Antworten (1)

James Tursa
James Tursa am 6 Mär. 2015
Bearbeitet: James Tursa am 6 Mär. 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 Kommentar
Sasha K
Sasha K am 7 Mär. 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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Fuzzy Logic Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by