Interval overlap not working
Mostrar comentarios más antiguos
Hi,
I'm trying to create a Matlab file to carry out pinch analysis. As part of it, I'm checking whether certain streams are present in a temperature interval.
function check_present(obj)
%Loops through each interval
for i = 1:length(obj.intervals)
%Creating "present" and "present names"
present = [];
present_names = [];
for k = 1:length(obj.streams)
%Checking if the ranges of the shifted temperatures
%overlap with the range of the stream temps, I think.
%Clearly, this bit is not working since it outputs the
%wrong thing.
if overlaps(fixed.Interval(obj.streams(k).Sin, obj.streams(k).Sout), fixed.Interval(obj.intervals(i).Tlow, obj.intervals(i).Thigh, '()'))
present = [present; obj.streams(k)];
present_names = [present_names; obj.streams(k).name];
end
end
obj.intervals(i).present = present;
obj.intervals(i).present_names = present_names;
This, however, is not doing what it's meant to, and is outputting the wrong streams in each interval. The matlab files are attached in case not enough information is given here!
Thanks in advance for any help.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Generate Test Data en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!