index must be a positive integer or logical
1 次查看(过去 30 天)
显示 更早的评论
Hi, Please how to solve this problem : "Attempted to access f(0); index must be a positive integer or logical" thnks
0 个评论
采纳的回答
Mischa Kim
2014-5-18
Sabrina, difficult to say without seeing the code. However, in MATLAB indexing starts with 1, not 0:
>> a = [4 3 2 1]
a =
4 3 2 1
>> a(0)
Subscript indices must either be real positive integers or logicals.
>> a(1)
ans =
4
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Optimization Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!