help-octave
[Top][All Lists]
Advanced

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

Re: Add row vector to column vector


From: Markus Mützel
Subject: Re: Add row vector to column vector
Date: Wed, 27 Nov 2019 16:54:52 +0100

Am 27. November 2019 um 16:34 Uhr schrieb "Jonathan Seidel":
> Hello,
> I am starting to learn octave. However I stumbled across the following:
>
> I defined a as a row-vector and b as a column vector. Then I added a + b and 
> expected some sort of error message, because the vectors down have the same 
> format. However, I received the following answer. Why ?
>
> >> a = [1 2 3]; b = [1; 2; 3];
> >> a + b
> ans =
>
>    2   3   4
>    3   4   5
>    4   5   6
>
> Thanks in advance for your help.

Octave uses automatic broadcasting. See also section 19.2 of the manual.

Markus



reply via email to

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