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

1 visualizzazione (ultimi 30 giorni)
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 ?

Risposta accettata

KALYAN ACHARJYA
KALYAN ACHARJYA il 5 Giu 2019
Modificato: KALYAN ACHARJYA il 5 Giu 2019
syms a b real
%.........^
H=a*i+b;
real_H=real(H)
imag_H=imag(H)
Output:
real_H =
b
imag_H =
a

Più risposte (0)

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