k is not an integer or valid index for your arrayt.
I did not inspect your code in details but you can simply add a different counter such asu = 1; before your for loops and change it as t(u, :) andu =u+1; it should be enough.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
2 Comments
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/259548-error-subscript-indices-must-either-be-real-positive-integers-or-logicals#comment_328518
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/259548-error-subscript-indices-must-either-be-real-positive-integers-or-logicals#comment_328518
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/259548-error-subscript-indices-must-either-be-real-positive-integers-or-logicals#comment_328673
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/259548-error-subscript-indices-must-either-be-real-positive-integers-or-logicals#comment_328673
Sign in to comment.