How to convert data sample with size 58 x 32 into matrikx 4x4
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Winda Mariana
il 26 Apr 2021
Commentato: Winda Mariana
il 28 Apr 2021
I have audio sample with size of 58 x 32. And I want to convert this sample into a 4 x4 matrix. Can anyone help me?
3 Commenti
Risposta accettata
Clayton Gotberg
il 26 Apr 2021
If I understand your new message correctly, you want to get all of the possible 4x4 matrices from this 56x32 matrix. In that case, try:
for j = 1:size(voice_frame,1)-3
for k = 1:size(voice_frame,2)-3
local_matrix{j,k} = voice_frame(j:j+3,k:k+3)
end
end
After this, the {j,k}th cell of local_matrix will be the 4x4 matrix in voice_frame that starts at (j,k).
If instead, you just want to break the big matrix up into smaller matrices, maybe this is closer:
for j = 1:size(voice_frame,1)/4
for k = 1:size(voice_frame,2)/4
local_matrix{j,k} = voice_frame(4*j-3:min(4*j,end),4*k-3:min(4*k,end))
end
end
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Data Type Conversion in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!