extracting the index of an irregular line on a 2D matrix

5 vues (au cours des 30 derniers jours)
hamed
hamed le 27 Nov 2020
Commenté : KSSV le 27 Nov 2020
Hi.
I have a 2D matrix and a vector which passes through some samples of this matrix irregularly. The vector values ​​shows the Y values ​​of the samples it passes through. I want to extract the index of each sample of this vector roughly. In other words, I want to know the corresponding index number of each vector sample, in the matrix. Please find attached the image. The vector values ​​are shown in white line passes throgh the 2D matrix (image).
Any suggestions?
Thanks.

Réponses (1)

KSSV
KSSV le 27 Nov 2020
Read about ismember.
A = rand(10) ;
B = A(randperm(100,10)) ;
[c,ia] = ismember(A(:),B) ;
A(c)
  7 commentaires
hamed
hamed le 27 Nov 2020
No
KSSV
KSSV le 27 Nov 2020
Then how you expect to extract? For every given t, we will get a complete column of x.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by