Turning a column vector into a rectangular matrix
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Matt Karlson
le 24 Nov 2015
Commenté : Matt Karlson
le 24 Nov 2015
I have a column vector of data and would like to break it up into a rectangular matrix. However, I would need to add NaN elements in order to make it rectangular; I have multiples pages of the column, how can I do this?
0 commentaires
Réponse acceptée
John D'Errico
le 24 Nov 2015
Modifié(e) : John D'Errico
le 24 Nov 2015
I wrote a wreshape tool some years ago. It pads as necessary, and allows you to specify the pad element. Not sure if I posted it on the file exchange, and I'm feeling too lazy to post it now. So I'll just attach it.
A = wreshape(1:5,[2 4],'pad',NaN)
A =
1 3 5 NaN
2 4 NaN NaN
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!