1
我得到這個錯誤在我的代碼:MATLAB錯誤:必須返回一個列向量
- 使用錯誤odearguments(91行) @(T,C)(C1 *((V1 (CA_ER-C)) - ((V3。*(C.^2))/(C.^2 +(K3^2))) 必須返回列向量。
但在MATLAB文檔中有一個例子Example 3其中向量是作爲輸入給出,但它工作得很好。爲什麼我的代碼中出現錯誤?
這是我的代碼:
Ca_ER = 10e-6;
c0 = 2e-6;
c1 = .185;
v1 = 6;
v2 = .11;
v3 = .09e6;
v4 = 1.2;
k3 = .1e-6;
a1 = 400e6;
a2 = 0.2e6;
a3 = 400e6;
a4 = 0.2e6;
a5 = 20e6;
b2 = .21;
d1 = 0.13e-6;
d2 = b2/a2;
d3 = 943.4e-9;
d4 = d1*d2/d3;
d5 = 82.34e-9;
IP= .5e-6;
Ca=.001e-6:.01e-6:1e-6;
num=Ca.*IP.*d2;
deno= (Ca.*IP+ IP*d2+d1*d2+Ca.*d3).*(Ca+d5);
p_open=(num./deno).^3; %this is the vector input
[email protected](t,c) (c1.*((v1.*p_open)+v2).*(Ca_ER-c))-((v3.*(c.^2))/(c.^2+(k3^2)));
[t,c]=ode45(dc,linspace(0, 100, 1000),.19e-6);
plot(t,c);
我沒有轉置和現在我得到這個錯誤:**使用錯誤odearguments(線93) @(T,C)(C1 *((V1。* P_OPEN)+ V2)。*(CA_ER-C)) - ((V3。*(C.^2))/(C.^2 +(K3^2))) 返回a (T,C)(C1。*((V1。* P_OPEN)+ V2)*(CA_ER-C))的矢量 。 - ((V3。*(C.^2))/(C.^2 +(K3^2))) and the initial conditions vector must have the same number of elements。** – nashynash
@nashynash - 你的第三個參數ode45。這需要成爲一個向量,但是你已經把它作爲一個單一的值。我不太瞭解你的問題發表評論......但是MATLAB的錯誤非常明顯......很難誤解他們所說的內容。 – rayryeng
第三個參數,你的意思是**(CA_ER-C)**。 我的目標是在本文[文章](http://www.pnas.org/content/89/20/9895.full.pdf)中生成圖4所示的結果。 – nashynash