strange Index exceeds matrix dimensions (MATLAB bug?)
Afficher commentaires plus anciens
Hi all,
I have a function running in particular the following code (sI and tdii2 are matrices):
% debugging
class(sI) % double
class(tdii2) % uint32
size(sI) % 512 672
numel(sI) % 344064
min(tdii2(:)) % 1
max(tdii2(:)) % 343988 (not 391863)
save('temp55.mat', 'sI', 'tdii2');
% this line produces an error
imgvals = sI(tdii2);
When I run it, it breaks with
??? Index exceeds matrix dimensions.
Error in ==> backproject_single at 133
imgvals= sI(tdii2);
Even worse, when I execute this
load('temp55.mat', 'sI', 'tdii2');
imgvals= sI(tdii2);
in the console, it works perfectly fine.
I am totally puzzled.... Has anyone an idea what the cause could be?
Thanks Thomas
Réponses (1)
Catégories
En savoir plus sur Matrix Indexing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!