Clear Filters
Clear Filters

How to pad zeros to an array?

43 views (last 30 days)
Minu
Minu on 30 May 2013
Hi
I have an array of data of size 5.I have to pad zeros to set the size as 10.How to add zeros of size 5.Help me please...

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 30 May 2013
Edited: Azzi Abdelmalek on 30 May 2013
A=[1 2 3 4 5]
A=[A zeros(1,5)]
%or
A(end+1:end+5)=0

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!