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

1 回表示 (過去 30 日間)
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.

採用された回答

madhan ravi
madhan ravi 2020 年 7 月 10 日
a(1:find(ismember(a,b))-1,1)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by