필터 지우기
필터 지우기

How to create row matrix?

조회 수: 2 (최근 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 CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by