extracting data from matrix
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello every bod
let assume matrix
A =
[10 20 1
30 40 2
50 60 3
70 80 4
90 100 5]
B =
[30 40
70 80]
we need to identify the third column of the matrix B, hence
B =
[30 40 2
70 80 4]
0 commentaires
Réponses (1)
Azzi Abdelmalek
le 16 Juil 2016
Modifié(e) : Azzi Abdelmalek
le 16 Juil 2016
A= [10 20 1
30 40 2
50 60 3
70 80 4
90 100 5]
B=[30 40
70 80]
idx=ismember(A(:,1:2),B,'rows')
B(:,3)=A(idx,3)
2 commentaires
Azzi Abdelmalek
le 16 Juil 2016
Modifié(e) : Azzi Abdelmalek
le 16 Juil 2016
Can you explain? post an example to make your question clear
Voir également
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!