I start in Matlab, I would like to calculate the concentration of the system and the timeline in a certain period of time following the code that I wrote
% Input function of 9 samples with activity and time calibrated using a well% counter value approximately: 1.856 of all 9 input values of 3 patients
function c_o = Sample_function(td,t_max,A,B)
t =(0 : 100 :5000); % time of the sample post injection in mins
c =(0 : 2275.3 :113765);
A_max= max(c); %Max value of Concentration (Peak of the curve)
if (t >=0 && t <= td)
c_o(t)=0;
else if(td <=t && t<=t_max)
c_o(t)= A_max*(t-td);
else if(t >= t_max)
c_o(t)=(A(1)*exp(-B(1)*(t-t_max)))+(A(2)*exp(-B(2)*(t- t_max)))+...
(A(3)*exp(-B(3)*(t-t_max)));
end
fprintf('plotting Data ...\n');
hold on;
figure;
plot(c_o);
xlabel('Activity of the sample Ba/ml ');
ylabel('time of the sample in minutes');
title (' Input function: Activity sample VS time ');
pause;
end
I get the following error
Operands to || and && operators must be converted to logical scalar values.
Error in Sample_function (line 18)
if (t >=0 && t <= td)
Request. Let me know if my logic is wrong
Devak source
share