Can someone tell me where is the problem? Matlab doesnt want to show me the real and the imag part of equation
이전 댓글 표시
>> syms A B d l >> real(0.98196*A*((-2+5i)^(d+l))+(6.0799*(-2+5i)^(1+l))+(40*(-2+5i)^l)+0.98196*B)
ans =
40*real((- 2 + 5*i)^l) + (60799*real((- 2 + 5*i)^(l + 1)))/10000 + (24549*real((- 2 + 5*i)^(d + l)*A))/25000 + (24549*real(B))/25000
>> imag((0.98196*A*((-2+5i)^(d+l))+(6.0799*(-2+5i)^(1+l))+(40*(-2+5i)^l)+0.98196*B))
ans =
40*imag((- 2 + 5*i)^l) + (60799*imag((- 2 + 5*i)^(l + 1)))/10000 + (24549*imag((- 2 + 5*i)^(d + l)*A))/25000 + (24549*imag(B))/25000
>>
답변 (1개)
Mischa Kim
2014년 3월 26일
편집: Mischa Kim
2014년 3월 26일
Stefan, the problem is that the real and imaginary parts depend on the values of the variables, of course. Let me illustrate with a simple example. Assume n is an integer:
syms n
x = i^n;
imag(x)
ans =
imag(i^n)
y = subs(x,n,3); % i^1 = i, i^2 = -1, i^3 = -i
imag(y)
ans =
-1
i^n can be either real, or, imaginary, depending on whether n is even, or, odd. So, in general, you will not get a numeric result for real and imaginary parts unless you numerically specify all variables involved.
카테고리
도움말 센터 및 File Exchange에서 Image Arithmetic에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!