Zeros of a complex surface
이전 댓글 표시
I have a complex matrix Z (evolving in time) and would like to know at which points both the real and the imaginary part of Z are null. I can do it graphically using the following code:
figure
set(gca,'fontsize',16)
for k = 1:size(T)
cla;
contour(HI0,HR0,real(Z{k}),[0,0],'b.')
hold on
contour(HI0,HR0,imag(Z{k}),[0,0],'r.')
hold on
legend(strcat('Re(Z): T=',num2str(T(k))),strcat('Im(Z): T=',num2str(T(k))));
xlabel H_I
ylabel H_R
pause(0.5);
end
which shows the intersections of the isocurves Re(Z)=0 and Im(Z)=0, but I am stuck here. If I take abs(Z), I am afraid not to get all the zeros.
Thanks a lot!
댓글 수: 2
Michelangelo Ricciulli
2017년 3월 7일
So you need to separately find where the real part and imaginary part are exactly zero,right?
Matthieu Michel
2017년 3월 8일
채택된 답변
추가 답변 (1개)
wrong approach,
people take abs(Z)==0 to solve the problem mentioned in your question PRECISELY because whem real(Z)==0 && imag(Z)==0 happens when abs(Z)==0 hits the ground, for continuous functions.
Obviously evaluating real and image for the same instant. You are not checking real at t0 and imag at t1 t1~=t2, are you?
Think it this way, the only complex points where you can ignore the angle are those with real and imaginary parts really small, both small at the same time.
That is precisely what abs() measures.
So, if it's about finding out [X Y] that meet
real(Z)==0 && imag(Z)==0
no need to split real and imag, go straight to
abs(Z)==0
if you find this answer useful would you please be so kind to mark my answer as Accepted Answer?
To any other reader, please if you find this answer of any help solving your question,
please click on the thumbs-up vote link,
thanks in advance
John BG
댓글 수: 4
Walter Roberson
2017년 3월 7일
Right. abs(a+1i*b) for real a and b is defined as sqrt(a^2 + b^2), which can only be 0 if both a and b are 0, so abs(a+1i*b) acts like an "and" test for both a and b being 0.
John BG
2017년 3월 7일
Precisely, Mr Roberson, no need to split real() imag(), aim at abs() and end problem.
Matthieu Michel
2017년 3월 8일
John BG
2017년 3월 8일
편집: John Kelly
2017년 3월 9일
Matthieu
now you have started wondering on the right direction.
Unless you are writing a PhD dissertation about the Complex plane, when the module is null, both Real() and Imag() are null.
With the really close values to zero, would you could do is to use floor() or ceil() or round(), or a combination of them with the right conditional commands.
The point is that you may save time using abs + floor, and it's time you have to write code solving something else.
I wonder if you would be so kind to mark my answer as accepted by clicking on the ACCEPT ANSWER button that only you see.
thanks in advance
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!