How to create row matrix?

1 回表示 (過去 30 日間)
baruch
baruch 2014 年 9 月 8 日
編集済み: Matt J 2014 年 9 月 8 日
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

採用された回答

Matt J
Matt J 2014 年 9 月 8 日
編集済み: Matt J 2014 年 9 月 8 日
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)];

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by