How can I compact a matrix to a define size?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Daniel Fonsêca
am 6 Sep. 2018
Kommentiert: Daniel Fonsêca
am 6 Sep. 2018
I'm trying to build a compact array. I have a array 8192x8192 and I want to make it for 1024 x 1024. See the code:
MC = zeros(8192/8);
for i= 1:8192/8
for j=1:8192/8
for m=1:8
for n = 1:8
MC(i,j) = MC(i,j) + M(i+m-1;j+n-1) % Size M = 8192X8192
end
end
end
end
0 Kommentare
Akzeptierte Antwort
KSSV
am 6 Sep. 2018
A = rand( 8192,8192) ;
B = imresize(A,[1024 1024]) ;
Read about imresize, interp2.
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices 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!