help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mean of 2 unequal matrices


From: Ben Abbott
Subject: Re: mean of 2 unequal matrices
Date: Sun, 07 Jun 2009 20:53:43 +0800

On Jun 7, 2009, at 8:50 PM, "John W. Eaton" <address@hidden> wrote:

On  7-Jun-2009, Ben Abbott wrote:

| On Jun 7, 2009, at 7:36 AM, Huub van Niekerk wrote:
|
| > Hi,
| >
| > I have 2 matrices: A: 200x1 and B: 300x1. I want to calculate the
| > mean of the combined data but when I do mean_all = mean(A + B) I get
| > these mesages because the matrices aren't of the same dimensions.:
| >
| > >mean_all = mean(A + B);
| > error: operator +: nonconformant arguments (op1 is 200x1, op2 is
| > 300x1)
| > error: evaluating binary operator `+' near line 12, column 28
| > error: evaluating argument list element number 1
| > error: evaluating assignment expression near line 12, column 10
| >
| > How can I accomplish this? By adding the means of A and B?
| >
|
|
| A + B is addition. You want a union.
|
| mean_all = mean (union (A, B));

Won't union throw out duplicate values?  Maybe you want

 mean  ([A; B])

?

jwe

You are certainly correct! My bad!

Ben


reply via email to

[Prev in Thread] Current Thread [Next in Thread]