From 71a8ad28f9aceba75b1c251eb6a36eeecc0ede54 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Luk=C3=A1=C5=A1=20Ji=C5=99i=C5=A1t=C4=9B?= Date: Tue, 7 May 2024 15:51:28 +0200 Subject: [PATCH] Add a function that generates pseudo experiment I add this function to generate data that is qualitatively similar to the data produced by the experiment. The real data may prove more difficult, but the structure of the processing should be the same. --- pseudo_exp.m | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 pseudo_exp.m diff --git a/pseudo_exp.m b/pseudo_exp.m new file mode 100644 index 0000000..a1af932 --- /dev/null +++ b/pseudo_exp.m @@ -0,0 +1,11 @@ +function [t, p, t_open] = pseudo_exp(p1, V1, V2, Vvz, n) + t_open = rand(1, n) * (50 - 15) + 15; + t_open = ceil(cumsum(t_open)); + t = (0:ceil(t_open(n)) + 20); + p = rand(size(t)) * p1 / 100; + for i = ceil(t_open) + p2 = (p(i + 1) * (V2 - Vvz) + p1 * V1) / (V1 + V2 - Vvz); + peq = 0.7 * p2; + p(i + 1:end) += (p2 - peq) * exp((-(i + 1:length(p)) + i) / 10) + peq; + end +end -- 2.30.2