필터 지우기
필터 지우기

vector manipulation in matlab

조회 수: 1 (최근 30일)
OLUBUKOLA ogunsola
OLUBUKOLA ogunsola 2016년 6월 1일
댓글: OLUBUKOLA ogunsola 2016년 6월 1일
hi say i have a vector v=[8 4 0 2 8 9 10 11] and i want to add a scaler 'a' ( which could be anything ) i'll write it this way: w=[v,a] ,but in case 'a' occurs more than one time which is not predetermined ( if it was two times it will be w=[v,a,a] ). Say 'n' times , how could i tell matlab to repeat 'a' n times in this format w=[v,a bla bla bla ] thanks

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2016년 6월 1일
w=[v repmat(a,1,n)]
  댓글 수: 1
OLUBUKOLA ogunsola
OLUBUKOLA ogunsola 2016년 6월 1일
thanks a lot , works fine

댓글을 달려면 로그인하십시오.

카테고리

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