Why does squeezing leading singleton dimensions produce inconsistent results
Afficher commentaires plus anciens
For example consider the following
size(squeeze(zeros([1 1 10])))
ans =
10 1
is the transpose of
size(squeeze(zeros([1 10])))
ans =
1 10
Réponses (1)
James Tursa
le 4 Juin 2015
Modifié(e) : James Tursa
le 4 Juin 2015
0 votes
This behavior is documented:
"B = squeeze(A) returns an array B with the same elements as A, but with all singleton dimensions removed. A singleton dimension is any dimension for which size(A,dim) = 1. Two-dimensional arrays are unaffected by squeeze."
Catégories
En savoir plus sur File Operations 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!