Explanation of the code sequence

1 回表示 (過去 30 日間)
elvin eziama
elvin eziama 2017 年 5 月 30 日
回答済み: Walter Roberson 2017 年 5 月 30 日
Given that T=zeros(100,100,10) and I want to understand this sequence T(1,:,9)

採用された回答

Walter Roberson
Walter Roberson 2017 年 5 月 30 日
T(1,:,9)
is the same as T(1,1:end,9) which is the same as T(1,1:size(T,2),9)
This says to take the combination of row 1, all columns, hyperpane #9, of T. The result will be size 1 by 100 by 1, which MATLAB will refer to as being 1 by 100 because it does not bother to keep track of trailing dimensions of length 1

その他の回答 (1 件)

Star Strider
Star Strider 2017 年 5 月 30 日
The notation ‘T(1,:,9)’ will return the first row, and all columns, in the 9th ‘page’ of ‘T’. (The third dimension is characteristically referred to as the ‘pages’ of a 3D matrix.)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by