how pad zero in matlab after each element in a row of matrix?

조회 수: 3 (최근 30일)
a=ones(1,100)
need to pad 5 zeros after each element in row i.e 1 0 0 0 0 0 10 0 0 0 0 so on please help me i am new to matlab thanks in advance

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 11월 3일
편집: KALYAN ACHARJYA 2019년 11월 3일
a=repmat([1 0 0 0 0 ],100)
%......................^ repeatation
Or
a=repmat([1 0 0 0 0 0],1,100);
You will get resultant array, which you are looking for , the resultabt will be 1x600, right?

추가 답변 (1개)

Walter Roberson
Walter Roberson 2019년 11월 3일
kron(a, [1 0 0 0 0 0])

카테고리

Help CenterFile Exchange에서 Numeric Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by