How to assume a symbolic function as real

23 visualizzazioni (ultimi 30 giorni)
Francesco
Francesco il 31 Ott 2014
Commentato: Sean de Wolski il 31 Ott 2014
Hi everyone, I am new to symbolic math toolbox in Matlab, and I need help to do the following.
I need to declare a symbolic function of time a(t) - say it's an angle of a rotating vector - and I want to get rid of all the conj(a(t)) expressions when differentiating trigonometric functions of a(t).
I tried:
syms t a(t) real;
conj(a(t))
ans =
conj(a(t))
What's the correct way to do this?
Thanks in advance.

Risposte (2)

Star Strider
Star Strider il 31 Ott 2014
Use the assume function:
syms t a(t) real
assume(a(t),'real')
conj(a(t))
produces:
ans =
a(t)
  2 Commenti
Sean de Wolski
Sean de Wolski il 31 Ott 2014
Beat me to it by 30s!
Star Strider
Star Strider il 31 Ott 2014
I’ve been there myself more often than I care to mention!
Thanks!

Accedi per commentare.


Francesco
Francesco il 31 Ott 2014
Thank you for the answer, I'm trying this in Matlab 2012, and it still gives:
syms t a(t) real
assume(a(t),'real')
conj(a(t))
ans =
conj(a(t))
Has it something to do with the version I'm using, or am I doing something wrong?
Thanks
  1 Commento
Sean de Wolski
Sean de Wolski il 31 Ott 2014
That's quite possibly an improvement that's been incorporated since then. If your company/university is current on maintenance, you can upgrade at no additional cost.

Accedi per commentare.

Categorie

Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by