Skip to content

Commit 7d3973f

Browse files
Fix phase space plot bug due to Octave
1 parent aff609f commit 7d3973f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/+otp/Problem.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,10 @@ function validateNewState(obj, newTimeSpan, newY0, newParameters)
168168
leg = {};
169169
else
170170
labels = cell(dim, 1);
171-
leg = @(i) strjoin(arrayfun(@obj.internalIndex2label, vars(i, :), 'UniformOutput', false), ' vs ');
171+
% Octave bug: function handle from class not working with
172+
% arrayfun so stored in local var first
173+
labelFun = @obj.internalIndex2label;
174+
leg = @(i) strjoin(arrayfun(labelFun, vars(i, :), 'UniformOutput', false), ' vs ');
172175
end
173176

174177
if dim == otp.utils.PhysicalConstants.TwoD

0 commit comments

Comments
 (0)