Path: news.mathworks.com!newsfeed-00.mathworks.com!solaris.cc.vt.edu!news.vt.edu!news.glorb.com!postnews.google.com!q15g2000yqk.googlegroups.com!not-for-mail
From: Jomar Bueyes <jomarbueyes@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Filling a vector A with all numbers from B starting at specific
 place in A
Date: Tue, 5 Jul 2011 05:10:45 -0700 (PDT)
Organization: http://groups.google.com
Lines: 29
Message-ID: <901498be-c3ee-4a94-8d6a-1063528437fe@q15g2000yqk.googlegroups.com>
References: <iuup79$cdm$1@newscl01ah.mathworks.com>
NNTP-Posting-Host: 140.247.106.115
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1309867845 652 127.0.0.1 (5 Jul 2011 12:10:45 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 5 Jul 2011 12:10:45 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: q15g2000yqk.googlegroups.com; posting-host=140.247.106.115; posting-account=UQjN4QoAAABmrUsSpLGrPgqLI4psJPvG
User-Agent: G2/1.0
X-Google-Web-Client: true
X-Google-Header-Order: HUALESNKRC
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US;
 rv:1.9.2.18) Gecko/20110614 Firefox/3.6.18,gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:734937

On Jul 5, 6:32 am, "Ulrik Nash" <u...@sam.sdu.dk> wrote:
> Hi Everyone,
>
> Suppose I have a vector B with data and that B has 10 rows.
>
> Suppose also I have an empty vector A with 20 row
>
> Now I wish to insert the data in B into A starting at column 11 in A
>
> So, the following won't work A(:,1) = B
>
> since this assumes that data should be inserted starting a place 1.
>
> So, how can I go about this?
>
> Regards,
>
> Ulrik.

You want to assign B to columns 11 to 20 of A, so index those columns:

A(:,11:20) = B;

This assumes that A already exists and has the same number of rows as
B.

HTH

Jomar