Solve matrix reshape error
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,
I have a 6 x 1200 matrix. For each row, I want to sum columns 1:600 and 601:1200 using the code below.
sum_dGwdt_gwd = squeeze(sum(reshape(sum_dGwdt_gwd,size(sum_dGwdt_gwd,1),600,[]),2)/50);
However, I keep getting the following error.
Error using reshape
Product of known dimensions, 3600, not divisible into total number of elements, 6.
It would be helpful if anyone can point out what I'm doing wrong.
Thank you.
1 Kommentar
Antworten (1)
KSSV
am 16 Dez. 2019
A = rand(6,1200) ;
iwant = [sum(A(:,1:600),2) sum(A(:,601:end),2)] ;
1 Kommentar
Siehe auch
Kategorien
Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!