Error in sym/subref
조회 수: 1 (최근 30일)
이전 댓글 표시
%Indicate variables
x0 =1.25;
S0 =86.63;
P0 =0;
Kd = 0.0032;
a = 0.6212;
Yps = 0.5820;
Ki = 243.95;
c = 0.5557;
Ks = 0.0191;
d = 30.7600;
syms t S
mu = ((c*S)/Ks+S+(S^2/Ki))*(1-(-Yps*S+Yps*S0+P0/d));
m1 = exp(int(mu,0,t));
m2 = (-a*c/Yps)*((S+Yps*S^2-Yps*S*S0-P0*S)/Ks+S+(S^2/Ki));
%% 1st method ODE
x=linspace(0,0.5,50);
h=0.5;
f1= 86.63;
for i = 1:length(x)
f(i+1) = f(i) + h*(m1(i)*m2(i));
end
Index exceeds the number of array elements (1).
Error in sym/subsref (line 900)
R_tilde = builtin('subsref',L_tilde,Idx);
댓글 수: 0
답변 (1개)
Walter Roberson
2021년 11월 11일
m1 and m2 are scalar symbolic expressions that do not involve x.
They do involve S. perhaps you want to subs(m1, S, x(i)) ?
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!