Understanding the coding in Matlab

2 ビュー (過去 30 日間)
Matpar
Matpar 2019 年 7 月 1 日
回答済み: Star Strider 2019 年 7 月 1 日
Hi I am having a challenge trying to understand the following code!!
Can a professional explain this for me please? It maybe simple but i need to get this asap!
I am constantly seeing this and its a tad difficult to understand!
Oh! and if you can point me in the direction to do some reading on this it will be immensly apprecited!
Thanks in advance for acknowledging my request!
t=mean(gbd(:));

採用された回答

Star Strider
Star Strider 2019 年 7 月 1 日
This line:
t=mean(gbd(:));
converts ‘gbd’ (that is likely a matrix) into a column vector, and then takes the mean of the vector. Most functions in MATLAB that can have matrix arguments require a specific dimension to calculate the result (here, mean) although 'all' is available in the last two releases. Creating a column vector using the (:) subscript convention takes the mean of the entire matrix, avoiding the need to do two nested mean calls.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by