简体   繁体   中英

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?

You need to specify that your symbolic vector is real :

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

ans =

rac1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM