Indexing via 3d array changed behaviour 2015a -> 2015b?
Mostrar comentarios más antiguos
Hi all, just got 2015b, here's a strange one where indexing via a multidimensional array has a differently shaped output to previous versions:
Code:
a = 1:10;
b = reshape(4:6,1,1,[]);
a(b)
2015a and before:
ans(:,:,1) =
4
ans(:,:,2) =
5
ans(:,:,3) =
6
2015b:
ans =
4 5 6
I searched through the release notes and couldn't find anything that relates to this behaviour change. Did I miss something? Or is this a bug that I should report?
1 comentario
David Young
el 15 de Oct. de 2015
I really hope someone answers this! It's very worrying that something as fundamental as array indexing might have quietly changed between versions. Of course the underlying problem is the inconsistent way indexing is applied to A(B) if both A and B are vectors. Since in this case isvector(b) returns 0, I think that the pre-2015b results are "correct", so to me it looks like a bug.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!