Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

Findall function

$
0
0

@anirudhpammi wrote:

I have a question regarding the internal code of the findall function. I have an array and I want to find elements that satisfy two conditions. I know that I can use something like findall(f:function,A) where A is the array. I have the following code:

A = [1;2;3;4;5];
findall(x->1<x<4,A)
findall(x->x>1&&x<4,A)
findall(x->x>1&x<4,A)
findall(x->x<4&x>1,A)

The first two commands return the correct answer: 2,3. The third one returns 2,3,4,5 and the fourth one returns 0-element Array.
Why don’t the last two commands work?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 2795

Latest Images

Trending Articles



Latest Images