find minimum distance value

di = Yk - Wi where i = 1.... Q and k=1...M
Y =
0
0.693062745098039
0.369047058823529
0.299000000000000
0.345615686274510
0.356407843137255
0
0
W=
0.890903252535799
0.959291425205444
0.547215529963803
0.138624442828679
0.149294005559057
0.257508254123736
0.840717255983663
0.254282178971531
what is the output of di?

댓글 수: 2

Anusha
Anusha 2013년 10월 19일
ADD
di=|yk-Wi|
Anusha
Anusha 2013년 10월 19일
one element at each iteration from y

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2013년 10월 19일

0 개 추천

[Yk, Wi] = meshgrid(Y, W);
min(Yk - Wi, 1)
min(Yk - Wi, 2)

댓글 수: 4

Anusha
Anusha 2013년 10월 19일
Look ADD part
Walter Roberson
Walter Roberson 2013년 10월 19일
When you see "||" around a mathematical expression, that stands for taking a metric. The default metric is absolute value, which is abs() in MATLAB.
Anusha
Anusha 2013년 10월 19일
ok
Anusha
Anusha 2013년 10월 19일
min(Yk - Wi, 1)
min(Yk - Wi, 2)
whats the meaning of 1,2

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

질문:

2013년 10월 19일

댓글:

2013년 10월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by