Filter löschen
Filter löschen

First occurance problem in the adjacent coloumn

2 Ansichten (letzte 30 Tage)
Anurag Gupta
Anurag Gupta am 28 Okt. 2020
Kommentiert: Anurag Gupta am 28 Okt. 2020
Hi,
i=1
j=2
I have a matrix A=[1 9
9 10
10 11
11 2]
I want to find out the first occurance of j in coloumn 2 after occurance of i in 1st coloumn at index idx.
i tried idx2 = find(A(idx:end, 2) == j, 'first') but it shows me error Second argument must be a positive scalar integer.
Help is much appreciated thanking in advance.

Antworten (1)

madhan ravi
madhan ravi am 28 Okt. 2020
[~, ix1_2] = max(A == [ii, jj])
  1 Kommentar
Anurag Gupta
Anurag Gupta am 28 Okt. 2020
Hi Madhan,
Thanks for replying to my query. although it is a bit difficult for me to understand the answer. it would be great if you can give a bit elaborative answer in context to my question.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by