Effacer les filtres
Effacer les filtres

change array into matrix

12 vues (au cours des 30 derniers jours)
Anusha
Anusha le 1 Fév 2014
Commenté : Anusha le 1 Fév 2014
How to write a 4 values in rectangular grid a=[8 4 6 2]
it will become
a=
8 4
6 2

Réponse acceptée

Mischa Kim
Mischa Kim le 1 Fév 2014
Modifié(e) : Mischa Kim le 1 Fév 2014
Use the reshape command.
b = reshape(a,2,2)
  3 commentaires
Mischa Kim
Mischa Kim le 1 Fév 2014
Is this another question or are you confirming that the command does what you need it to do?
Anusha
Anusha le 1 Fév 2014
if i have a array with 50 numbers how it will be converted into rectangular matrix

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