Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!news.glorb.com!postnews.google.com!k1g2000prb.googlegroups.com!not-for-mail
From: perfreem@gmail.com
Newsgroups: comp.soft-sys.matlab
Subject: Re: averaging vectors of different dimensions
Date: Mon, 19 Jan 2009 19:15:21 -0800 (PST)
Organization: http://groups.google.com
Lines: 35
Message-ID: <58d9841e-9bcf-455d-973f-70d9055a278d@k1g2000prb.googlegroups.com>
References: <d54e80af-5e1c-4601-9f1a-b7742ffb268a@g38g2000yqn.googlegroups.com> 
	<gl34os$oib$1@fred.mathworks.com>
NNTP-Posting-Host: 18.139.5.63
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1232421321 12341 127.0.0.1 (20 Jan 2009 03:15:21 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 20 Jan 2009 03:15:21 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: k1g2000prb.googlegroups.com; posting-host=18.139.5.63; 
	posting-account=aj71ngoAAAAYxQ83mJE8SXkq6oPGq18K
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; 
	rv:1.9.0.5; Google-TR-3) Gecko/2008120121 Firefox/3.0.5,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:512599


On Jan 19, 7:10=A0pm, "Sadik " <sadik.h...@gmail.com> wrote:
> perfr...@gmail.com wrote in message <d54e80af-5e1c-4601-9f1a-b7742ffb2...=
@g38g2000yqn.googlegroups.com>...
> > hello,
>
> > i am tryin to average together several columns of different matrices,
> > each column of slightly different sizes (difference might be one or
> > two elements).
> > for example, my columns a, b, c might be:
> > =A0 a =3D my_mat1(:, 2); # size 10
> > =A0 b =3D my_mat2(:, 2); # size 12
> > =A0 c =3D my_mat3(:, 2); # size 11
>
> > i want to make a new vector d that contains the averages of all their
> > values. the first 10 values can be averaged, then for the 11th i want
> > to have the average of b and c's values, and for the 12 value i only
> > want c's value.
>
> > is there an easy way to do this? a simple: a' + b' + c' ./ 3 does not
> > work because a b and c are all different sizes....
>
> > =A0 =A0 thank you.
>
> How about this one [I believe in the text you have written c instead of b=
, because in the code, it seems that it is b whose length is 12]:
>
> ([a;0;0]+b+[c;0])./[3*ones(length(a),1);2;1]

hi sadik,

thanks for your reply.

i am talking about the general case here though, the a, b, c was just
an example. i want to do this for n-many different vectors of all
potentially slightly different sizes...