Hurricane Development
Hurricane Development

Reputation: 2464

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?

Upvotes: 2

Views: 536

Answers (1)

gnovice
gnovice

Reputation: 125874

You need to specify that your symbolic vector is real:

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

ans =

rac1

Upvotes: 5

Related Questions