Sum (rendezvous equation) in matlab

I want to write the below equation(rendezvous) in matlab, i belongs to {1,2,…,7} , write a for loop for i and a switch for j, but I don’t know how to write the sum properly, will you help

回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2016 年 7 月 2 日

2 投票

out = sum(bsxfun(@minus,x(:),x(:)'),2);

カテゴリ

質問済み:

2016 年 7 月 2 日

回答済み:

2016 年 7 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by