Effacer les filtres
Effacer les filtres

How to create row matrix?

2 vues (au cours des 30 derniers jours)
baruch
baruch le 8 Sep 2014
Modifié(e) : Matt J le 8 Sep 2014
I have Nc=3 and want to get row matrix as A=[1;1;1;-1;-1;-1] so what will be it's command.If I vary value of Nc rows change accordingly.I need generalized formula for that

Réponse acceptée

Matt J
Matt J le 8 Sep 2014
Modifié(e) : Matt J le 8 Sep 2014
The matrix A that you've shown is a column vector, not a row vector. Giving just one example for A doesn't explain the pattern you're looking for, but I'm guessing this is what you want
A=[ones(Nc,1); -ones(Nc,1)];

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices 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