How to select column 2 in a matrix

27 vues (au cours des 30 derniers jours)
Brendan Steele
Brendan Steele le 27 Jan 2022
Commenté : Brendan Steele le 27 Jan 2022
I have a 4 by 5 matrix and I need to select column 2 and make it into a new matrix . Im pretty new to coding so i dont know many complex things in matlab.

Réponse acceptée

KSSV
KSSV le 27 Jan 2022
A = rand(4,5) ;
A2 = A(:,2) % extract second column
: this stands for all in this case. The command extract entire row of second column.
  1 commentaire
Brendan Steele
Brendan Steele le 27 Jan 2022
Thank you the second one worked for me

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by