Le lundi 30 mars 2015 à 04:54 -0500, Tim Holy a écrit :
> A=rand(4,4); A[:,vec(A[1,:].>0.7)]
And as regards your second question:
A=rand(4,4); A[:, 0.7 .< vec(A[1,:]) .< 0.9]

(Note that the array indexing rules are currently under discussion, and
vec() might no longer be needed in future releases.)


Regards

> --Tim
> 
> On Sunday, March 29, 2015 12:07:10 PM Andreas ten Pas wrote:
> > How can we do the following *Matlab* code in *Julia*?
> > 
> > A=rand(4); A(:,A(1,:)>0.7)
> > 
> > I've tried this in *Julia*:
> > 
> > A=rand(4,4); A[:,A[1,:].>0.7]
> > 
> > And how would we combine multiple *boolean comparisons* in the indexing such
> > as *A(:,A(1,:)>0.7 & A(1,:)<0.9)*?

Reply via email to