Groups | Search | Server Info | Login | Register


Groups > comp.soft-sys.octave > #103

Re: loop-free comparison of different sized vectors

From Andreas Weber <info@tech-chat.de>
Newsgroups comp.soft-sys.octave
Subject Re: loop-free comparison of different sized vectors
Date 2017-06-16 08:15 +0200
Organization albasani.net
Message-ID <ohvt2b$fob$1@news.albasani.net> (permalink)
References <46e9236f-4049-4a39-86b4-094d25cbee12@googlegroups.com> <e61b7d86-cd56-4214-92f4-99595e17687f@googlegroups.com>

Show all headers | View raw


Am 08.06.2017 um 06:59 schrieb peknott@arcor.de:
> Am Montag, 10. März 2014 12:16:07 UTC+1 schrieb José Ignacio Royo Prieto:
>> More precisely, if v and w are vectors of lengths n and m, respectively, 
>> I want to produce a matrix A of dimensions nxm such that 
>> A(i,j)=1 if v(i)>w(j) and 0 otherwise.

A = v'>w;

Does what you want. This uses automatic broadcasting, you can also use
it explicitely with "bsxfun"

-- Andy

Back to comp.soft-sys.octave | Previous | NextPrevious in thread | Find similar


Thread

loop-free comparison of different sized vectors José Ignacio Royo Prieto <joseignacioroyoprieto@gmail.com> - 2014-03-10 04:16 -0700
  Re: loop-free comparison of different sized vectors peknott@arcor.de - 2017-06-07 21:59 -0700
    Re: loop-free comparison of different sized vectors Andreas Weber <info@tech-chat.de> - 2017-06-16 08:15 +0200

csiph-web