Help regarding finding the values below intersect value from two different dimension matrix

1 view (last 30 days)
I want to know how can I obtain the value less than intersection value between two different dimension matrix. for example i have matrix a=[1;2;5;6;89;90] and matrix b=[5;89;90;100]. I want to get if any one value in the two matrix are same then output should be value below that value in matrix a. In this case the a and b matrix has first common value as 5 so my out put matrix should give me c=1;2.

Accepted Answer

madhan ravi
madhan ravi on 10 Jul 2020
a(1:find(ismember(a,b))-1,1)

More Answers (0)

Categories

Find more on Multidimensional Arrays 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!