Matrix and Averaging problems
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Joydeb Saha
am 22 Apr. 2021
Kommentiert: Atsushi Ueno
am 22 Apr. 2021
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)
0 Kommentare
Akzeptierte Antwort
Atsushi Ueno
am 22 Apr. 2021
V = rand(180,1);
step1 = reshape(V, [15 12]);
step2 = mean(step1);
step3 = step1 - step2;
2 Kommentare
Atsushi Ueno
am 22 Apr. 2021
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;
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!