집중과 시간의 관계를 그래프로 나타내려고합니다.Matlab : 연속 함수를 그릴 수 없습니다.
농도와 시간 사이의 관계는 불연속 함수
C(t) =0 for t>=0 & t <=td
C(t) =A_max(t-td) t>=td && t<=t_max
3
C(t) = Σ a(n)*e^-(b(n)*(t-t_max)) t> t_max /exponential decay
n=1
값을 TD로 표시 입력 난의 값을 섭취 다음 함수를 작성한이 조각 별 함수
값 t_max되어있다 TD, t_max 시간 대 A1, A2, A3, B1, B2, B2와 같은 플롯 농도 계수
function c_o = Sample_function(td,t_max,a1,a2,a3,b1,b2,b3)
t =(1:5:5000); % time of the sample post injection in mins
c_o =(0 : 2275.3 :113765); % activity of the sample calibrated with Average well counter
A_max= max(c_o);%Max value of Concentration (Peak of the curve)
for i=1:length(t)
if((t(i)>0) && (t(i)<=td))
c_o(i)=0;
elseif((t(i)>=td) && (t(i)<=t_max))
c_o(i)= A_max*(t(i)-td);
else(t(i)>t_max)
c_o(i)=(a1*exp(-b1*(t(i)-t_max)))+(a2*exp(-b2*(t(i)- t_max)))+(a3*exp(-b3*(t(i)-t_max)));
end
end
fprintf('plotting Data ...\n');
%figure ;
plot(c_o(i));
xlabel('time of the sample in minutes ');
ylabel('Activity of the sample Ba/ml');
title (' Input function: Activity sample VS time ');
pause;
end
위 함수 플롯해야 t, td.t_max, a1, a2, a3, b1, b2, b3의 각 값에 대한 농도 값은 사용자가 제공하고 t, td.t_max, a1, a2, a3, b1 값에 따라 플롯이 달라야합니다 , b2, b3.
은 친절하게 내 코드를 검토하시기 바랍니다이, 내가 지금 손에 matlab에없는 조각 현명한 기능
오류 메시지가 있습니까? 입력 데이터없이 코드를 실행하는 것은 불가능합니다. – Daniel
오류 기능이 없습니다, 내가 작성한 기능은 평화로운 기능이며, td, t_max, a1, a2, a3, b1, b2, b3의 입력 값은 다양 할 수 있습니다. 예를 들어, Sample_function (1040115520002100,5,4,2) 그러나이 입력 값으로 플롯 할 수 없습니다. – Devak
'plot'의 입력을 확인하고,'0' 및 스칼라 '0'을 표시합니다. ''erasemode ','background''는 함수의 잘못된 사용법 인 것 같습니다. – Daniel