Append vector to another vector

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Append vector to another vector

turbofib
hi,
i try this:

 a(end+1)=[6 7 8]

but i receive error
( i need append vector..not a single scalar)





--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: Append vector to another vector

Colin Macdonald-2
On 2018-10-03 10:39 a.m., turbofib wrote:
> i try this:
>
>   a(end+1)=[6 7 8]
>
> but i receive error
> ( i need append vector..not a single scalar)

a(end+1) = 6
a(end+1) = 7
a(end+1) = 8

or something like

a(end+1:end+3) = [6 7 8]

cheers


Reply | Threaded
Open this post in threaded view
|

Re: Append vector to another vector

marco atzeri-2
Am 03.10.2018 um 19:44 schrieb Colin Macdonald:

> On 2018-10-03 10:39 a.m., turbofib wrote:
>> i try this:
>>
>>   a(end+1)=[6 7 8]
>>
>> but i receive error
>> ( i need append vector..not a single scalar)
>
> a(end+1) = 6
> a(end+1) = 7
> a(end+1) = 8
>
> or something like
>
> a(end+1:end+3) = [6 7 8]
>
> cheers
>

also

a=[1 2 3]
a =

    1   2   3

  a=[a 4 5 6]
a =

    1   2   3   4   5   6

a=[a 7 8 9]
a =

    1   2   3   4   5   6   7   8   9


---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.com/antivirus



Reply | Threaded
Open this post in threaded view
|

Re: Append vector to another vector

Doug Stewart-4
In reply to this post by turbofib


On Wed, Oct 3, 2018 at 1:39 PM turbofib <[hidden email]> wrote:
hi,
i try this:

 a(end+1)=[6 7 8]

but i receive error
( i need append vector..not a single scalar)





--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



try this
a= 20:30
a=[a [ 3 4 5]]


--
DASCertificate for 206392



Reply | Threaded
Open this post in threaded view
|

Re: Append vector to another vector

turbofib