On Wed, Nov 27, 2019 at 10:43 AM Jonathan Seidel <
address@hidden> wrote:
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.
Greetings,
Jonathan
Hi Jonathan,
If you want to make sure they're the same size, you'll need to check to see if size(a) is equal to size(b).
Hope this helps,
James Sherman Jr.