matrix iteration and subtraction

1 次查看(过去 30 天)
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
d = abs(bsxfun(@minus,y(:),s(:)'));

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by