multiply numbers in a table

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

1 个评论

You mean to replicate them, not multiply them. Multiplication is an arithmetic operation as I recall.

请先登录,再进行评论。

 采纳的回答

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

更多回答(3 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by