AnsweredAssumed Answered

matlab - handling bad values

Question asked by MikeFFSwhy on May 8, 2019
Latest reply on May 9, 2019 by MikeFFSwhy

What's the best way to handle bad values returned from the PI Server?

for j = 1:length(Point)
   values{j} = Point{j}.InterpolatedValues(timerg, inter, '', true);
   [object{j}, DateTime{j}, flags{j}] = values{j}.GetValueArrays;
   mymatrix(:,j) = cell2mat(object{j}.cell');
end

This works very well unless it encounters a bad value, at which point cell2mat will fail.  You can weed out bad values by

values{1}.RemoveAt(234)

But I haven't found a way to either prevent them from getting into values in the first place, or weed them out manually or by lengthy iteration.  Any help would be much appreciated!

 

Thanks.

Outcomes