Mercurial > repos > public > sbplib
comparison +time/blargh.m @ 1101:b895037bb701 feature/timesteppers
Add functions for evaluating a functions for each timestep.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 09 Apr 2019 22:04:51 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1100:27aaf8646a80 | 1101:b895037bb701 |
---|---|
1 % Takes nSteps with ts and evaluates the provided function handles | |
2 % for each step and collects the output | |
3 function varargout = blargh(ts, nSteps, varargin) | |
4 N = length(varargin); | |
5 | |
6 for j = 1:N | |
7 Fj = varargin{j}(ts); | |
8 varargout{j} = zeros(length(Fj),nSteps+1); | |
9 varargout{j}(:,1) = Fj; | |
10 end | |
11 | |
12 for i = 2:nSteps+1 | |
13 ts.step(); | |
14 | |
15 for j = 1:N | |
16 varargout{j}(:, i) = varargin{j}(ts); | |
17 end | |
18 end | |
19 end | |
20 % TODO: Name and discuss this funcition |