Let us try to perform some of the same operations for multiplication as we did for addition:

octave:75> a*aans = 4octave:76> a*bans =2 4 6octave:77> b*berror: operator *: nonconformant arguments (op1 is 1x3, op2 is 1x3)octave:78> b*cans = 14

From Command 75, we see that `*`

multiplies two scalar variables just like standard multiplication. In agreement with linear algebra, we can also multiply a scalar by each element in a vector as shown by the output from Command 76. Command 77 produces an error—recall that `b`

is a row vector which Octave also interprets as a 1 x 3 matrix, so we try to perform the matrix multiplication (1 x 3)(1 x 3), which is not valid. In Command ...

Start Free Trial

No credit card required