help-octave
[Top][All Lists]
Advanced

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

Re: AGAIN A SIMPLY QUESTION


From: James Sherman Jr.
Subject: Re: AGAIN A SIMPLY QUESTION
Date: Tue, 11 Sep 2007 15:28:35 -0400

Now I'm a bit confused, could you give us an example of what the
output you desire would look like if B is not all ones?

James

P.S.  If you're just copying the matrix, Rupert's method is better.  I
didn't know about the repmat function.

On 9/11/07, Oscar Bayona Candel <address@hidden> wrote:
>
>
> Thank you . But it will function if B will always be ones matrix but it is
> not the case.
> > Date: Tue, 11 Sep 2007 13:39:27 -0400
> > From: address@hidden
> > To: address@hidden
> > Subject: Re: AGAIN A SIMPLY QUESTION
> > CC: address@hidden
>
> >
> > You could always do some simple multiplication:
> >
> > B = ones(3, 1) * A;
> >
> > I can't think of a faster way, since writing a for loop to replace
> > each row individually is bound to be slower.
> >
> > James
> >
> > On 9/11/07, Oscar Bayona Candel <address@hidden> wrote:
> > >
> > >
> > > Hi,
> > >
> > > There is any function that if I want to replace a row vector in all rows
> of
> > > a matrix could do it?
> > >
> > > In example:
> > >
> > > A=[ 2.5 3.6 2 3 9] %this is an 1x5 vector
> > >
> > > B=[1 1 1 1 1
> > > 1 1 1 1 1
> > > 1 1 1 1 1] % B is an 3x5 matrix
> > >
> > > I number of colums of A and B always coincide how can I replace all rows
> of
> > > B for A so that
> > >
> > > I obteine this result?
> > >
> > > (this should be the result)
> > >
> > > B=[2.5 3.6 2 3 9
> > > 2.5 3.6 2 3 9
> > > 2.5 3.6 2 3 9]
> > >
> > >
> > > As always, thanks in advance, and best regards. Sorry again if I express
> > > incorrectly.
> > >
> > >
> > > ________________________________
> > > Llama a tus amigos de PC a PC: ¡Es GRATIS! Pruébalo
> > > _______________________________________________
> > > Help-octave mailing list
> > > address@hidden
> > > https://www.cae.wisc.edu/mailman/listinfo/help-octave
> > >
> > >
>
> ________________________________
> Consigue el nuevo Windows Live Messenger Pruébalo



reply via email to

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