Skip to content

Commit e18862d

Browse files
committed
initial commit to subscript indexing
1 parent 144cd13 commit e18862d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/+otp/RHS.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@
4040
newF = @(t, y) objF(t, y) + otherF(t, y);
4141
newRHS = otp.RHS(newF);
4242
end
43+
44+
function newRHS = subsref(obj, vs)
45+
if vs.type == '.'
46+
newRHS = obj.(vs.subs);
47+
else
48+
objF = obj.F;
49+
newF = @(t, y) subsref(objF(t, y), vs);
50+
newRHS = otp.RHS(newF);
51+
end
52+
end
4353

4454
function opts = odeset(obj, varargin)
4555
opts = odeset( ...

0 commit comments

Comments
 (0)