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

4 次查看(过去 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