Effacer les filtres
Effacer les filtres

divide the matrix to blocks

5 vues (au cours des 30 derniers jours)
Aseel H
Aseel H le 25 Avr 2013
I need to divide matrix to blocks have size (1*3) how can write (for loop) to get blocks as the following example
matrix = [1 4 3 5 7 1;4 2 1 5 4 7;8 0 1 4 5 6] I need first block = [1 4 3] second block = [5 7 1] third block = [4 2 1]
and so on
  1 commentaire
Cedric
Cedric le 25 Avr 2013
What have you tried so far?

Connectez-vous pour commenter.

Réponse acceptée

Matt J
Matt J le 25 Avr 2013
  5 commentaires
Aseel H
Aseel H le 26 Avr 2013
No, I can not use matrix(:,1:3:end) = 4*matrix(:,1:3:end); because I need deal with values of each block alone,for example
X = [5 6 4 7 9 8;5 0 1 4 7 3];
after that: cell1 = [5,6,4] cell2 = [7,9,8] and do on
After that will be execute some operations on the values of each individual cell, according to some conditions if they apply to the three values in each cell or not
In other words how I call on the values of each cell
The first value of cell one the second value of cell one ......... etc
Matt J
Matt J le 26 Avr 2013

Connectez-vous pour commenter.

Plus de réponses (1)

Aseel H
Aseel H le 25 Avr 2013
Modifié(e) : Matt J le 25 Avr 2013
Deleted by Matt J

Community Treasure Hunt

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

Start Hunting!

Translated by