take cells outside arrays to form new matrix

3 ビュー (過去 30 日間)
Kuang-Yu WANG
Kuang-Yu WANG 2018 年 6 月 26 日
コメント済み: Kuang-Yu WANG 2018 年 6 月 26 日
myarrays ={26*7 double} {43*7 double} .....{32*7 double} i could not get the (1,4) cell of each matrix to calculate the mean. the command i type is >>mean(myarrays{:}(1,4)), but the result have 63 output. how can i get one output of the mean from the (1,4) of all my matrix?

採用された回答

OCDER
OCDER 2018 年 6 月 26 日
mean(cellfun(@(x) x(1,4), myarrays))
  1 件のコメント
Kuang-Yu WANG
Kuang-Yu WANG 2018 年 6 月 26 日
i still have a question. if i need to get the mean of (40,4) however the cell does not exist in every matrix. i tried the scrip u send but matlab just saying "Index exceeds matrix dimensions."

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by