Filter löschen
Filter löschen

How to get a number in matlab

7 Ansichten (letzte 30 Tage)
Wajahat
Wajahat am 1 Sep. 2018
Kommentiert: Wajahat am 1 Sep. 2018
m1=.1+.8*1i;
m2=.5+.8*1i;
A=(m2-conj(m2)).*(m1-m2).*(m1-conj(m2)).*(m1.^2+conj(m1).^2)+m1^2.*(m1-conj(m1)).*((m1-m2).*(conj(m1)-m2)+(m1-conj(m2)).*(conj(m1)-conj(m2)))-(m1-conj(m1)).*(m2.^2.*(m1-conj(m2)).*(conj(m1)-conj(m2))-conj(m2).^2.*(m1-m2).*(conj(m1)-m2));
B=4*m1.*conj(m2).*(m1-conj(m1)).*(m1-m2)-4*m1.*conj(m1).*(m1-m2).*(m1-conj(m2));
C=2*A./B;
solve(C)
How to get the value for C? C would be just a number.
  1 Kommentar
madhan ravi
madhan ravi am 1 Sep. 2018
TRY THIS:
m1=.1+.8*1i;
m2=.5+.8*1i;
A=(m2-conj(m2)).*(m1-m2).*(m1-conj(m2)).*(m1.^2+conj(m1).^2)+m1^2.*(m1-conj(m1)).*((m1-m2).*(conj(m1)-m2)+(m1-conj(m2)).*(conj(m1)-conj(m2)))-(m1-conj(m1)).*(m2.^2.*(m1-conj(m2)).*(conj(m1)-conj(m2))-conj(m2).^2.*(m1-m2).*(conj(m1)-m2));
B=4*m1.*conj(m2).*(m1-conj(m1)).*(m1-m2)-4*m1.*conj(m1).*(m1-m2).*(m1-conj(m2));
C=2*A./B

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

KALYAN ACHARJYA
KALYAN ACHARJYA am 1 Sep. 2018
Bearbeitet: KALYAN ACHARJYA am 1 Sep. 2018
m1=.1+.8*1i;
m2=.5+.8*1i;
A=(m2-conj(m2)).*(m1-m2).*(m1-conj(m2)).*(m1.^2+conj(m1).^2)+m1^2.*(m1-conj(m1)).*((m1-m2).*(conj(m1)-m2)+(m1-conj(m2)).*(conj(m1)-conj(m2)))-(m1-conj(m1)).*(m2.^2.*(m1-conj(m2)).*(conj(m1)-conj(m2))-conj(m2).^2.*(m1-m2).*(conj(m1)-m2));
B=4*m1.*conj(m2).*(m1-conj(m1)).*(m1-m2)-4*m1.*conj(m1).*(m1-m2).*(m1-conj(m2));
C=2*A./B
  4 Kommentare
KALYAN ACHARJYA
KALYAN ACHARJYA am 1 Sep. 2018
Bearbeitet: KALYAN ACHARJYA am 1 Sep. 2018
No need of solve statement, just vectorization. Check my answer code, I have removed the solve statement
Wajahat
Wajahat am 1 Sep. 2018
@ACHARJYA confirm, thnx

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Operating on Diagonal Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by