MATLAB: Multiply numbers in a table

numbers multiply

Assume the following numbers in a table
1
2
3
4
How can I multiply them in the following manner:
1
1
1
1
2
2
2
2
3
3
3
3
4
4
4
4
thanks

Best Answer

Try
x = [1;2;3;4];
reshape( repmat( transpose(x), [4,1]), [], 1 )