[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: create matrix : (1:3)(1:5)
From: |
michele |
Subject: |
Re: create matrix : (1:3)(1:5) |
Date: |
Wed, 24 Oct 2018 11:49:19 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 |
On 10/24/18 11:41 AM, turbofib wrote:
hi
i want to create this matrix:
a=1 1 1 1 1
2 2 2 2 2
3 3 3 3 3
--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
Hi,
you can do as follows:
a = repmat([1,2,3]',1,5)
or, using broadcasting,
a = ones(1,5) + [0,1,2]'
--
Michele Ginesi