Hill Equation coding

4 ビュー (過去 30 日間)
Poonam
Poonam 2011 年 4 月 17 日
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 日
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?

カテゴリ

Help Center および File ExchangeEquations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by