Discussion:
create matrix : (1:3)(1:5)
turbofib
2018-10-24 09:41:18 UTC
Permalink
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
michele
2018-10-24 09:49:19 UTC
Permalink
Post by turbofib
hi
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
turbofib
2018-10-24 10:10:10 UTC
Permalink
thank you michele

use to repmat is correct !



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
Marco Atzeri
2018-10-24 09:49:00 UTC
Permalink
Post by turbofib
hi
a=1 1 1 1 1
2 2 2 2 2
3 3 3 3 3
and what is your problem ?

https://octave.org/doc/interpreter/Simple-Examples.html#Creating-a-Matrix



---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.
Continue reading on narkive:
Loading...