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

4 Ansichten (letzte 30 Tage)
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

Akzeptierte Antwort

KALYAN ACHARJYA
KALYAN ACHARJYA am 3 Nov. 2019
Bearbeitet: KALYAN ACHARJYA am 3 Nov. 2019
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?

Weitere Antworten (1)

Walter Roberson
Walter Roberson am 3 Nov. 2019
kron(a, [1 0 0 0 0 0])

Kategorien

Mehr zu Numeric Types finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by