Search code examples
matlabsymbolic-math

Dot product of symbolic vector


I am trying to take the dot product of a symbolic vector and another vector. I did the following:

>> rac = sym('rac',[3 1])

  rac =

    rac1
    rac2
    rac3

>> i = [1;0;0]

  i =

    1
    0
    0

>> dot(rac,i)

  ans =

    conj(rac1)

However my desired outcome is rac1. Why is it not behaving like I want it to? And how do I achieve this output?


Solution

  • You need to specify that your symbolic vector is real:

    rac = sym('rac', [3 1], 'real');
    dot(rac, [1; 0; 0])
    
    ans =
    
    rac1