Error in sym/subref
4 views (last 30 days)
Show older comments
%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 Comments
Answers (1)
Walter Roberson
on 11 Nov 2021
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 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!