help-octave
[Top][All Lists]
Advanced

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

Re: constructing a matrix from a vector


From: ishi soichi
Subject: Re: constructing a matrix from a vector
Date: Wed, 19 Oct 2011 13:51:48 +0900

Ah, yes. You're taking that course as well? :)

I wanted to execute element-wise subtraction.

4 5 6         1 2 3
7 8 9     - 
1 2 3
4 5 6

like that. ".-" doesn't do the job.  If there is a better way, it's great.
But my solution was correct at least using repmat :)

soichi



2011/10/19 Jordi Gutiérrez Hermoso <address@hidden>
On 18 October 2011 23:02, ishi soichi <address@hidden> wrote:
> say, we have a vector,
> (1 2 3)
> Can we construct a matrix like
>
> 1 2 3
> 1 2 3
> 1 2 3
> 1 2 3
> ?

Why do you want such a matrix? Note that there is usually a better
solution than using repmat. What's the larger context? Is this for the
machine learning class? ;-)

- Jordi G. H.


reply via email to

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