How can I compare columns from 2 different numeric arrays and when they match define a new column in array A with the value of a second column in array B?
Show older comments
For example:
A(:,1)= [1 2 3 4 5 6]
B(:,1)=[0 0 0 2 0 5]
B(:,2)=[20 20 20 10 80 60]
And the goal is to create the following (zeros indicating there was no match):
A(:,2)=[0 10 0 0 60 0]
Accepted Answer
More Answers (0)
Categories
Find more on Software Development in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!