Index exceeds array bounds.
古いコメントを表示
clc; clear;
dt = 0.5;
Glucose = zeros(1,361);
Glucose(1,1) = 6000;
Glucose_Released = 110;
Glucose_Used = zeros(1,361);
Usage_Fraction = zeros(1,361);
t = 0:dt:180; % We need to generate a time vector for our plot
for k = 2:length(t)
Glucose_Used(k) = Glucose(k) * Usage_Fraction(k); % Based on Euler?sformula
Glucose(k-1) = Glucose(k) + [Glucose_Released(k) - Glucose_Used(k)]*dt;
end
Please help!!
3 件のコメント
Sudhaunsh Deshpande
2021 年 4 月 28 日
Adam Danz
2021 年 4 月 28 日
Question edited to format code.
@Sudhaunsh Deshpande, looks like David hit the nail on the head. Let us know if you have any other questions.
Sudhaunsh Deshpande
2021 年 4 月 28 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Mathematics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!