Irregular Arrays for fixed.Interval Objects
显示 更早的评论
Hi,
I am working on code in which I am constructing an interval of valid inputs and I have been using fixed.Interval objects. My code involves taking the set difference between intervals and this is resulting in having irregular-sized objects in the following manner (example with basic numbers):
% Initial Valid Inputs
valid = fixed.Interval([1;3],[2;4])
% Invalid Inputs
invalid = fixed.Interval([1.4;3.5],[1.6;4])
% Valid Inputs in First Variable Once Removing Invalid
valid_hold1 = setdiff(valid(1),invalid(1))
% Valid Inputs in Second Variable Once Removing Invalid
valid_hold2 = setdiff(valid(2),invalid(2))
Now, the issue is my two valid interval sets are 1x2 and 1x1 since in the one variable the valid inputs are now split into two intervals. As such the intervals can not be concatenated into a single fixed.Interval object in order to be returned. Of course, at such a small scale simply doing individual variables would be fine, but I need to expand it to an arbitrary number of variables. I thought of using a cell array, however fixed.Interval objects do not fit in cells. Does anyone have an idea on a way to solve this problem?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Generate Test Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!