Index of individual points of two data set in matlab plot

4 ビュー (過去 30 日間)
Arvind Kumar Pathak
Arvind Kumar Pathak 2019 年 5 月 20 日
コメント済み: KSSV 2019 年 5 月 20 日
clear all
clc
load('scaphoid.mat')
% load('capitate.mat')
A = scaphoid;
% c = capitate(:,1:3);
% [index,tnorm]=MyRobustCrust(c);
% trisurf(index,c(:,1),c(:,2),c(:,3),'facecolor',[1 1 1],'edgecolor',[0.8 0.8 0.8])%plot della superficie trattata
% hold on;
Y = scaphoid(:,1:3);
[index,tnorm]=MyRobustCrust(Y);
trisurf(index,Y(:,1),Y(:,2),Y(:,3),'facecolor',[1 1 1],'edgecolor',[0.8 0.8 0.8])%plot della superficie trattata
hold on
dcmObject = datacursormode;
pause
datacursormode off
cursor = getCursorInfo(dcmObject);
dzvalx = cursor.Position(1)
dzvaly = cursor.Position(2)
dzvalz = cursor.Position(3)
for i = 1:length(A)
x = A(i,1); y = A(i,2); z = A(i,3);
tol = 1e-2;
mzValueIndice = find(abs(x - dzvalx) <= tol); %for floats
mzValueIndice1 = find(abs(y - dzvaly) <= tol); %for floats
mzValueIndice2 = find(abs(z - dzvalz) <= tol); %for floats
if mzValueIndice1 == 1 & mzValueIndice1 == 1 & mzValueIndice2 == 1
disp(i)
end
end
%%%%%%%%%%%%%%%%%%%%%%%
For one body I am able to finf the index of point by clicking on it.
How to for two bodies
  2 件のコメント
KSSV
KSSV 2019 年 5 月 20 日
What index you want?
Arvind Kumar Pathak
Arvind Kumar Pathak 2019 年 5 月 20 日
Index of any point in matlab plot.
Means by clicking on any individual point, it gives the index no of that point which tells the position of that point in that matrix.

サインインしてコメントする。

回答 (1 件)

KSSV
KSSV 2019 年 5 月 20 日
Read about knnsearch to get the indices of multiple points.
  2 件のコメント
Arvind Kumar Pathak
Arvind Kumar Pathak 2019 年 5 月 20 日
How to implement knnsearch for two matrix at a same time.
Please provide some example. I have not use knnsearch before.
KSSV
KSSV 2019 年 5 月 20 日
Read the documentation part......

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by