Find egual number Classic List Threaded 5 messages Open this post in threaded view
|

Find egual number

 f=[1   2   3   4   4   7   7   6   8   5] it's possible to find >1 egual element? i want to know this position f(4)=4    f(5)=4 f(6)=7  f(7)=7 Ans=4,5        6,7 -- Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
Open this post in threaded view
|

Re: Find egual number

 On 2/9/19 5:58 AM, LucaLuca wrote: > f=[1   2   3   4   4   7   7   6   8   5] > > it's possible to find >1 egual element? i want to know this position > > f(4)=4    f(5)=4 > > f(6)=7  f(7)=7 > > Ans=4,5 >         6,7 I am genuinely curious---there's what looks like to be a group of Italian gentlemen: [hidden email] [hidden email] [hidden email] that regularly ask about Octave problems that, to me, share some common characteristics, in that they explore the intricacies of syntax, in ways that don't seem to be connected to actual practical problems. To me, it looks like either someone's exploration of intricacies of Matlab, or a series of homework etudes. It actually occurred to me that it could be a Google algorithm similar to Alpha Zero http://science.sciencemag.org/content/362/6419/1140 , trying to learn mathematical computing :), especially since when I tried to answer one of them (the last one) directly the email address bounced. But, hey, let's play along. I am not sure that I understand the problem as stated above but maybe something along the lines of k=1:length(f) find(f(k)==k) or find(f(k)!=k) would be a solution.
Open this post in threaded view
|

Re: Find egual number

 hi, i'm subscrive mailing list.., now i can reveive your email about you solution is not correct because if i change element in array Example: f=[14  54  54  65   78  67 78 67 67 78 67] k=1:length(f) find(f(k)==k) ans = [](1x0) and it's not correct because you have set  a wrong loop but never mind… -- Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html