Array Error Must be Positive
1 回表示 (過去 30 日間)
古いコメントを表示
I keep getting an error for the array. I'm not sure what is wrong
0 件のコメント
回答 (1 件)
David K.
2021 年 3 月 5 日
If you read the whole error message you see this :
Array indices must be positive integers or logical values.
This is caused by the values of t in:
y(t) = ...
The issue in this case is not that they are not positive. It is that they are not integers.
This is actually solved very simply as such:
t = 0:.1:5;
b = [2;4.7;9.2;]
y = 1-exp(-b*t)
参考
カテゴリ
Help Center および File Exchange で Multidimensional Arrays についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!