Hill Equation coding

Hi,
I am having trouble coding for the Hill Equation. I have written the code but when I try to code for equation B, the error message that pops up is: ??? Subscript indices must either be real positive integers or logicals.
Error in ==> practice1 at 13 B = A + Kd(k) * (1+ (sum ((factorial (k)/(factorial (k-i)*factorial (i)))/(prod(Kd*j))))) %part of equation for Q
Here is my code thus far:
sum = 0; %initialize sum Kd = 4; %dissociation constant - input k = 1; %Hill coefficient i = 1; %needed for calculation of sum j = 1; %needed for calculation of prod
for L = (1:5); %for Ligand concentration from 1 to 5 micro-Molar
A = (L).^k / prod(Kd) %part of equation for Q
B = A + Kd(k) * (1+ (sum ((factorial (k)/(factorial (k-i)*factorial (i)))/(prod(Kd*j))))) %part of equation for Q
Q(L) = A/B %A over B equals Bound receptor-ligands over Total Receptors
end %end loop
figure (1) %1st figure plot (Q) %plot Q vs L ... Bound/Total vs Ligand Concentration
-- I understand that I am doing something wrong with the SUM part of the equation, but I don tunderstand how to fix it. Any help will be much appreciated! Thank you!

답변 (1개)

Poonam
Poonam 2011년 4월 17일

0 개 추천

we got the sum function to work by doing this:
for L = (1:200); %for Ligand concentration from 1 to 200 micro-Molar
A = (L).^k / prod(Kd); %part of equation for Q
f = (factorial (k)/(factorial (k-i)*factorial (i)))/(prod(Kd*j)); % portion of equation for B
sum = sum + f; % sum equals sum plus f to be part of equation B
B = A + Kd(k) * (1 + sum); %portion of equation for Q
Q(L) = A/B; %A over B equals Bound receptor-ligands over Total Receptors
end %end loop
can anyone tell me if this is the correct way to do it?

카테고리

도움말 센터File Exchange에서 Equations에 대해 자세히 알아보기

질문:

2011년 4월 17일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by