Matrix and Averaging problems

2 ビュー (過去 30 日間)
Joydeb Saha
Joydeb Saha 2021 年 4 月 22 日
コメント済み: Atsushi Ueno 2021 年 4 月 22 日
say I have a matrix V = 180x1 double.
STEP 1 = I need to make 15 matrices, 12x1 column each ( Say Jan to Dec)
STEP 2= I need to take the average of all the Januaries .. (First row of every matrix), then Februaries (First row of every matrix)..upto Dec
STEP 3= I need to do (Jan - avg of all the Januaries)... (Dec- avg of all the Decs) for all the matrices. I will have again 15 matrices (12x1)

採用された回答

Atsushi Ueno
Atsushi Ueno 2021 年 4 月 22 日
V = rand(180,1);
step1 = reshape(V, [15 12]);
step2 = mean(step1);
step3 = step1 - step2;
  2 件のコメント
Joydeb Saha
Joydeb Saha 2021 年 4 月 22 日
step1 should be = reshape(V, [12 15])
step 2 = mean of each row of all the matrices.
step 3= first element minus avg of all the first element and so on..
please help
Atsushi Ueno
Atsushi Ueno 2021 年 4 月 22 日
Sorry, I misunderstood about step2. Step2 shall be 1*15 right?
V = rand(180,1);
step1 = reshape(V, [12 15]);
step2 = mean(step1);
step3 = step1 - step2;

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by