Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pkg load odepkg % needed in octave but not in matlab
- % example input function f and domain [xmin, xmax]x[ymin, ymax]
- f = @(x, y) x+y.*y;
- xmin = 0, xmax = 2, ymin = 1, ymax = 2;
- % integrated over x
- F = @(y) ode45(@(t, x) f(t, y), [xmin, xmax], 0);
- clf
- for y=ymin:0.1:ymax
- [t, I] = F(y);
- disp(I')
- plot(t, I), hold on
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement