reshape a column vector in a row-wise direction?

14 vues (au cours des 30 derniers jours)
Ernest Adisi
Ernest Adisi le 16 Août 2018
Modifié(e) : James Tursa le 16 Août 2018
if I have column vector A= 1;2;3;4;5;6;7;8;9;10 how do I get matlab to reshape it in the row wise direction so it becomes
A= 1 2 3 4 5
6 7 8 9 10
as the reshape function seems to take it in column wise direction format?

Réponse acceptée

KSSV
KSSV le 16 Août 2018
A= [1;2;3;4;5;6;7;8;9;10 ] ;
B = reshape(A,[],2)'
  3 commentaires
Ernest Adisi
Ernest Adisi le 16 Août 2018
hey thanks for answering, if i want it reshaped with a certain row r column c, would it be reshape(A,[],r,c)'. I have to import data from a column vector into a certain r and c
Ernest Adisi
Ernest Adisi le 16 Août 2018
oh got it now thanks

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical 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