matrix iteration and subtraction

y=
6
7
2
4
S=
8
1
3
0
d=|y-s| for each iteration y take one value and subtract with each value of s eg: first iteration d=
2
5
3
6
how to find d value for four iterations

 採用された回答

Andrei Bobrov
Andrei Bobrov 2013 年 10 月 31 日

0 投票

d = abs(bsxfun(@minus,y(:),s(:)'));

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

質問済み:

2013 年 10 月 31 日

回答済み:

2013 年 10 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by