Array indices must be positive integers or logical values
1 次查看(过去 30 天)
显示 更早的评论
Hello All,
I am trying to rearrange the elements in a matrix based on index values using matrix indexing.
I have tried multiple times, checked each and every element in the matrix - every element is positive and >0 and <1504 (length of matrix). I wonder why I still get this error
Kindly, help me with this.
Please find the attachments for the required matrices and data. The following is the command I used:
Output = input_sequence(IntOutAdr);
0 个评论
采纳的回答
Stephen23
2021-5-10
"every element is positive and >0"
Nope:
S = load('data_req.mat')
find(S.IntOutAdr==0)
更多回答(1 个)
David Fletcher
2021-5-10
Error is caused by element 1481 of IntOutAdr which is 0 - this will cause an indexing error
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!