Index exceeds matrix dimension
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have this error and I do not understand why. Here's the code:
>> I1_inliers
I1_inliers =
608×1 SURFPoints array with properties:
Scale: [1×608 single]
SignOfLaplacian: [1×608 int8]
Orientation: [1×608 single]
Location: [608×2 single]
Metric: [1×608 single]
Count: 608
>> I1_inliers(1)
ans =
SURFPoints with properties:
Scale: 2.8000
SignOfLaplacian: 1
Orientation: 0.3424
Location: [753.3676 999.5223]
Metric: 1.8129e+04
Count: 1
>> I1_inliers(2)
Index exceeds matrix dimensions.
I have the same error for every index but 1.
5 comentarios
Adam
el 12 de Jun. de 2017
Editada: Adam
el 12 de Jun. de 2017
I suspect that it is actually a scalar with an overloaded size function, looking at it again. I have done that myself once or twice on a class (and usually regretted it afterwards because it confuses me too much).
The size function can be overloaded so that in a case like yours where the object contains a lot of arrays all of the same size the 'size' function is programmed to return that size which over-rides the usual size function which would return [1 1] as the size.
So even though it claims to be a 608x1 array it actually isn't and is just a scalar object containing arrays of length 608.
You would need to access the individual properties with indexing in that case.
I don't have the Computer Vision Toolbox though so I am just surmising based on the symptoms you describe and what is shown when you display the object
Respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!