필터 지우기
필터 지우기

finding out Mahalanobis distance

조회 수: 2 (최근 30일)
Mayank Lakhani
Mayank Lakhani 2016년 3월 16일
답변: VM Sreeram 2023년 7월 5일
I have two matrix.
I want to have result matrix which has a size of 8*1. Moreover, the G2 matrix elements should be compared with G1 and the nearest elements( Using Mahalanobis distance, matlab function mahal) of G2 to G1 should be filled up in desired matrix. for example first one of G2 row has NaN, so it keep it NaN. 4th row of G2 has two values, this values should be compared with 4th element of G1 and nearest value (Using Mahalnobis distance, matlab function mahal) shoud be filled up in the result matrix. When there is a single value than it should be remain like this only. When there are more than two values than the nearest value should be filled up in the matrix.
G1 =
80.00
79.43
78.89
78.38
77.90
77.45
77.03
76.63
G2 = NaN NaN NaN
NaN NaN NaN
NaN 79.11 NaN
NaN 78.64 NaN
NaN 78.13 78.14
77.46 NaN 77.66
77.07 77.08 NaN
76.74 NaN NaN

답변 (1개)

VM Sreeram
VM Sreeram 2023년 7월 5일
This seems to be a duplicate of this question.
See this answer for that question.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by