X-Received: by 10.67.3.34 with SMTP id bt2mr3467181pad.41.1383013387183;
        Mon, 28 Oct 2013 19:23:07 -0700 (PDT)
X-Received: by 10.50.3.70 with SMTP id a6mr257109iga.16.1383013387104; Mon, 28
 Oct 2013 19:23:07 -0700 (PDT)
Path: news.mathworks.com!newsfeed-00.mathworks.com!news.kjsl.com!usenet.stanford.edu!z6no61041788pbz.1!news-out.google.com!9ni96qaf.0!nntp.google.com!o2no7493020qas.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: comp.soft-sys.matlab
Date: Mon, 28 Oct 2013 19:23:06 -0700 (PDT)
In-Reply-To: <l4n5q7$5s4$1@speranza.aioe.org>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=202.78.152.105;
 posting-account=qPexFwkAAABOl8VUndE6Jm-9Z5z_fSpR
NNTP-Posting-Host: 202.78.152.105
References: <l4mu44$lbi$1@speranza.aioe.org> <l4n11b$emp$1@newscl01ah.mathworks.com>
 <l4n5q7$5s4$1@speranza.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <52f0bebb-5e6f-4a95-b6d3-67155adc5bcb@googlegroups.com>
Subject: Re: Sequence of numbers
From: TideMan <mulgor@gmail.com>
Injection-Date: Tue, 29 Oct 2013 02:23:07 +0000
Content-Type: text/plain; charset=ISO-8859-1
Lines: 68
Xref: news.mathworks.com comp.soft-sys.matlab:804508

On Tuesday, October 29, 2013 3:16:55 PM UTC+13, dpb wrote:
> On 10/28/2013 7:55 PM, Ulrik Nash wrote:
> 
> > dpb <none@non.net> wrote in message <l4mu44$lbi$1@speranza.aioe.org>...
> 
> >> This is an example of the result I wish to achieve:
> 
> >>
> 
> >> [2 2 2 3 3 3 4 4 4]
> 
> >>
> 
> >> More generally, I wish to create a vector starting at min and finishing
> 
> >> at max, displaying n numbers of each value, with increments, inc, of 1.
> 
> >>
> 
> >> In the above example, min = 2, max = 4, n = 3, and inc = 1.
> 
> >>
> 
> >> Can this be done without looping?
> 
> >>
> 
> >> yes...
> 
> >>
> 
> >> --
> 
> > Okay then, prove it :-)
> 
> >
> 
> > (perhaps I was asking for trouble)
> 
> 
> 
> One way...
> 
> 
> 
> I was just answering your question--you didn't ask "how"... :)
> 
> 
> 
>  >> n1=1;n2=3;rep=3;
> 
>  >> cell2mat(accumarray([1:3]',[n1:n2]',[],@(x,y) {repmat(x,rep,1)}))'
> 
> ans =
> 
>       1     1     1     2     2     2     3     3     3
> 
>  >>
> 
> 
> 
> 
> 
> --

No, dpb, that's way to complicated, try this:
v=ones(n,1)*[min:inc:max];
v=v(:);