I have a vector of length 100. I want to add two zeros after each element, to create a new vector of length 300.
(b) Write the Matlab code to do this.
%Adding 2 zeros after each element
i got the output of b=1x300 double as required but I was wondering if there was an easier and faster method in padding 'n' zeros after each element?
For example: Padding one zero after each element:
b_up = reshape([b; zeros(size(b))],1,);
Is there any way to modify the above code to pad 'n' zeros instead of one zero after each element?