matrix iteration and subtraction

1 Ansicht (letzte 30 Tage)
Anusha
Anusha am 31 Okt. 2013
Beantwortet: Andrei Bobrov am 31 Okt. 2013
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

Akzeptierte Antwort

Andrei Bobrov
Andrei Bobrov am 31 Okt. 2013
d = abs(bsxfun(@minus,y(:),s(:)'));

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by