Array indices must be positive integers or logical values.
이전 댓글 표시
Error in TASKA (line 22)
A(t)=(A0-B0/YB)./(1-(B0/(YB*A0))*exp(-((YB*A0/B0)-1)*K*B0.*t));
댓글 수: 5
David Hill
2022년 3월 6일
What is the value of t? The only thing you are indexing into is A. The error appears to tell you that t is not a positive integer or logical value.
Navaneetha Krishnan Murugadoss
2022년 3월 6일
David Hill
2022년 3월 6일
You cannot index with 0 (indexing for matlab starts at 1)
Navaneetha Krishnan Murugadoss
2022년 3월 6일
David Hill
2022년 3월 6일
Cannot help further unless you provide more information (all variables with values and context)
답변 (2개)
Image Analyst
2022년 3월 6일
A thorough discussion is in the FAQ:
In the meantime, try getting rid of (t) on the left hand side.
A = (A0-B0/YB) ./ (1-(B0/(YB*A0)) .* exp(-((YB*A0/B0)-1)*K*B0 .* t));
Navaneetha Krishnan Murugadoss
2022년 3월 6일
댓글 수: 3
Image Analyst
2022년 3월 6일
편집: Image Analyst
2022년 3월 6일
You posted this as the "Answer".
So, did this "Answer" of your fix it? Otherwise take another look at my answer.
Navaneetha Krishnan Murugadoss
2022년 3월 6일
plot(rand(1,5), '-o')
plot(rand(1,5), '-O')
plot(rand(1,5), '-0')
which is to say that your '-0' is dash-zero and that is not a recognized line style or color. Using dash-oh or dash-capital-oh is fine.
카테고리
도움말 센터 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

