Replace values in a matrix
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
stelios loizidis
am 4 Aug. 2021
Kommentiert: stelios loizidis
am 4 Aug. 2021
Hello. I have the following problem.
I have a matrix A with dimensions 1X72. I want in matrix B to have the mean per 24 values. That is, matrix B should be 1X3. Next, I want those values in matrix A above 50 to be replaced by the mean. That is, any value in positions A (1:24) above 50 to be replaced by the mean found in B (1), any value in positions A (25:48) exceeding 50 to be replaced by the mean located in B (2) and any value in positions A (49:72) exceeds 50 to be replaced by the mean in B (3).
Your help is invaluable !!!
5 Kommentare
Rik
am 4 Aug. 2021
Since you seem to be prepared to hard-code the indices: can you think of a way to use my hint to solve your own question?
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices 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!