how to find real&imagenery part of complecs symbolic expression ?

1 vue (au cours des 30 derniers jours)
tomer polsky
tomer polsky le 5 Juin 2019
Commenté : KALYAN ACHARJYA le 5 Juin 2019
lets say i want to get real &imegenry part of symbolic complex expression . so I wrote this simple code :
clc;clear all;
syms a b
H=a*i+b
real_H=real(H)
how ever the answer is not correct ,is there and other way ?

Réponse acceptée

KALYAN ACHARJYA
KALYAN ACHARJYA le 5 Juin 2019
Modifié(e) : KALYAN ACHARJYA le 5 Juin 2019
syms a b real
%.........^
H=a*i+b;
real_H=real(H)
imag_H=imag(H)
Output:
real_H =
b
imag_H =
a
  2 commentaires
tomer polsky
tomer polsky le 5 Juin 2019
thank you very much!
KALYAN ACHARJYA
KALYAN ACHARJYA le 5 Juin 2019
Welcome @Tomer

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by