Dividing matrices of different dimensions

3 vues (au cours des 30 derniers jours)
Gucci
Gucci le 11 Mai 2022
Réponse apportée : Chunru le 11 Mai 2022
Hello,
I have one image matrix A, 512 x 512, and I have another matrix, B 8x8,
I want to transform matrix B, 8x8 matrix, into a 512x512 matrix by repeating the values over and over.
How can I do this?
Alternatively, how can I divide every 8x8 section of matrix A by matrix B ?
Thank you

Réponse acceptée

Chunru
Chunru le 11 Mai 2022
B = reshape(1:64, 8, 8); % generate B matrix
A = repmat(B, [32 32]); % repeating 32x32
imagesc(A)

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by