-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheval_model.m
More file actions
30 lines (21 loc) · 830 Bytes
/
eval_model.m
File metadata and controls
30 lines (21 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function F = eval_model( c, model, paras)
%Evaluation of a transition model. Returns function values for the
%transition models.
% Usage:
% F = eval_model(C, MODEL, PARAS)
% F array containing the function values for MODEL in C with the
% parmeter vector PARAS. PARAS contains the parameters in the order
% specified by the parameter name list PARALIST returned by
% PARALIST = vecpar(MODEL).
%
% Copyright (c) 2019 Martin Rabe
[~, P] = mappar (model, paras);
% for enabling evaluation of the model P as cell structure is needed.
P = num2cell(P);
F = zeros(length(c), length(model));
for modelNo = 1: length(model)
for cPos = 1:length(c)
F(cPos ,modelNo) = model{modelNo}(c(cPos),...
P{~isnan(cell2mat(P(:,modelNo))),modelNo});
end
end