Commit 9ded254e authored by Jakob Gabriel's avatar Jakob Gabriel
Browse files

quantity.Discrete.solveAlgebraic(): fixed bug for strange special case...

parent 65dc8ee7
......@@ -491,7 +491,8 @@ classdef (InferiorClasses = {?quantity.Symbolic, ?quantity.Operator}) Discrete
assert(numel(objLimit)==2, 'a lower and upper limit must be specified (or neither)');
objValueTemp = obj.on();
gridSelector = (objValueTemp >= objLimit(1)) & (objValueTemp <= objLimit(2));
gridSelector([find(gridSelector, 1, 'first')-1, find(gridSelector, 1, 'last')+1]) = 1;
gridSelector([max(1, find(gridSelector, 1, 'first')-1), ...
min(find(gridSelector, 1, 'last')+1, numel(gridSelector))]) = 1;
limitedGrid = obj(1).grid{1}(gridSelector);
objCopy = obj.copy();
objCopy.changeGrid({limitedGrid}, gridName);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment