Dear all,

I need to zero-pad the columns of an N-D array x to a length N. I've found the following solution:

siz = size(x);
a = repmat(0,[N, siz(2:$)]);     // Create array of 0's whose columns have length N                                  // and the remaining dimensions are the same as in x
a(1:siz(1), :) = x;              // Replace non-padding 0's by x

This seems to work. However, I'm concerned about the use of the last : as a replacemant for all the remaining dimensions, since I couldn't find it documented. Is it an intended behviour?

Regards,

Federico Miyara
_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

Reply via email to