Effacer les filtres
Effacer les filtres

How to Reshape matrix.

3 vues (au cours des 30 derniers jours)
Gareth Evans
Gareth Evans le 18 Sep 2012
Hello,
Say i have a 1x365 matrix. How would i create a matrix of 24x365 where the data from the initial matrix column (1x365) would be propagated down the entire column in the second matrix (24x365).
cheers
  2 commentaires
Thomas
Thomas le 18 Sep 2012
A 1x365 array has 365 elements, how could you reshape it to 24X365 matrix of 8760 elements? reshape needs the two matrices to have the same number of elements. Do you intend to pad you matrix with zeros?
Azzi Abdelmalek
Azzi Abdelmalek le 18 Sep 2012
It's not reshaping. what you need is replicate your vector,

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 18 Sep 2012
Modifié(e) : Walter Roberson le 18 Sep 2012
repmat(YourMatrix, 24, 1)
  1 commentaire
Gareth Evans
Gareth Evans le 18 Sep 2012
Thats the one. Ive used repmat before, just a little rusty. Thankyou...(-:

Connectez-vous pour commenter.

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