Matlab:连续卷积和绘图

时间:2014-02-17 01:10:45

标签: matlab for-loop plot convolution

我想用输出浓度方程计算输入浓度值的循环卷积并相应地绘制,以下是我的函数

输入浓度的函数计算如下,并绘制浓度Vs时间图

function c = Input_function(t, a1, a2, a3, b1, b2, b3, td, tmax)



c = zeros(size(t));

ind = (t > td) & (t < tmax);
c(ind) = (t(ind) - td) ./ (tmax - td) * (a1 + a2 + a3);


ind = (t >= tmax);
c(ind) = a1 * exp(-b1 * (t(ind) - tmax))+ a2 * exp(-b2 * (t(ind) - tmax)) + a3 * exp(-b3   * (t(ind) - tmax));





plot(t, c);
%plot(t,c_t);
hold all;


axis([-100 5000 -2000 80000]);
xlabel time ;
ylabel concentration ;

end

现在我想用以下公式计算上述函数的卷积。

C_tot = ((k1*k2)/(k2+k3))*exp(-(k2+k3)*t) + (k1*k3)/(k2+k3)

其中C_tot表示输出方程。

基本上我必须计算

的卷积
C_tot and C(ind) at (t > td) & (t < tmax)

C_tot and C(ind) at (t >= tmax)

并相应地绘制它们,请告诉我如何在matlab中处理此问题,值K1,K2 K3是用户定义的

0 个答案:

没有答案