Multiplying vector members without repeating

1 次查看(过去 30 天)
Hi I need to multiply values from one vector in all combinations. For example Lets say that vector A=[1 2 3 4]' I need to get these products 1*2 1*3 1*4 2*3 2*4 3*4
Thanks for help

采纳的回答

Stephen23
Stephen23 2018-7-4
编辑:Stephen23 2018-7-4
>> A = 1:4;
>> prod(nchoosek(A,2),2)
ans =
2
3
4
6
8
12

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by