フィルターのクリア

Multidimensional for loop to store values/frame

1 回表示 (過去 30 日間)
Uma Dixit
Uma Dixit 2020 年 2 月 12 日
回答済み: KSSV 2020 年 2 月 12 日
Hello all,
I have a multidimensional array of 300x430x180. I need to efficiently calculate and store:
  • An average value per frame
  • The st.dev
  • The median per frame
  • The range per frame (the difference between the lowest/highest value in each frame)
Essentially my ideal output is a structure that contains
  • AvgValues (1x180)
  • St.dev (1x180)
  • Median (1x180)
  • Range(1x180)
I wanted to implement this into a for loop so it can run and store these values as it goes through the 180 frames. I am definitely overthinking this and need someone to point me in the correct direction.

回答 (1 件)

KSSV
KSSV 2020 年 2 月 12 日
You can reshape the matrix into 2D and use the respective functions.
A = rand(2,2,5) ;
A = reshape(A,[],5) ;
Avg = mean(A) ;

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by