Array indices must be positive integers or logical values.
1 次查看(过去 30 天)
显示 更早的评论
I am trying to represent to functions in matlab app designer but when I run the interface and click the buttom the app send me this mesage:'Array indices must be positive integers or logical values.'. How can I solve? this is my code:
P = app.P.Value;
Q = app.Q.Value;
a = app.a.Value;
b = app.b.Value;
Xo = app.Xo.Value;
Yo =app.Yo.Value;
K = b.*Xo-a.*Yo;
C3 = (log(a.*Yo)-log(Xo))/- K;
C4 = (log(b.*Xo)-log(Yo))/- K;
t = 0:0.2:100;
y(t) = K./(exp((K*t-K*C3))-b);
y (0) = app.Yo.Value;
plot (app.Axes,x,y3,'r');
hold (app.Axes,'on')
x(t) = - K./(exp(K*t-K*C4)-a);
x(0) = app.Xo.Value;
plot (app.Axes,x,y4,'b');
hold (app.Axes,'off')
2 个评论
Stephen23
2021-2-23
t = 0:0.2:100;
y(t) = .. % t is not positive integer
y(0) = .. % 0 is not positive integer
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!