Array indices must be positive integers or logical values

1 Ansicht (letzte 30 Tage)
mounika am 10 Mai 2021
Kommentiert: mounika am 10 Mai 2021
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);

Akzeptierte Antwort

Stephen23 am 10 Mai 2021
"every element is positive and >0"
S = load('data_req.mat')
S = struct with fields:
IntOutAdr: [1×1504 double] input_sequence: [1×1504 double]
ans = 1481

Weitere Antworten (1)

David Fletcher
David Fletcher am 10 Mai 2021
Error is caused by element 1481 of IntOutAdr which is 0 - this will cause an indexing error


Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by