extracting data from matrix
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Azzi Abdelmalek
2016-7-16
编辑:Azzi Abdelmalek
2016-7-16
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 个评论
Azzi Abdelmalek
2016-7-16
编辑:Azzi Abdelmalek
2016-7-16
Can you explain? post an example to make your question clear
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!