Why does squeezing leading singleton dimensions produce inconsistent results

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

回答 (1 件)

James Tursa
James Tursa 2015 年 6 月 4 日
編集済み: James Tursa 2015 年 6 月 4 日

0 投票

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."

カテゴリ

ヘルプ センター および File ExchangeRobust Control Toolbox についてさらに検索

タグ

質問済み:

Jan
2015 年 6 月 4 日

編集済み:

2015 年 6 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by