It is easy to assign repeated values to an array:
x(1:10) = 5;
If you want to generate the array of elements inline in a statement try something like this:
ones(1,10) * 5
or with repmat
repmat(5, 1, 10)
It is easy to assign repeated values to an array:
x(1:10) = 5;
If you want to generate the array of elements inline in a statement try something like this:
ones(1,10) * 5
or with repmat
repmat(5, 1, 10)