Diffraction pattern manipulation.
조회 수: 2 (최근 30일)
이전 댓글 표시
I want to know how to take only the right part of a diffraction pattern matrix. Here is the diffraction pattern in a 1000x1000 matrix :
Here is the code I am using to take only the part from the center to the first 0 of the 'sinc like' pattern
Mask_radius = 0.431*dx;
Mask = sqrt(X.^2 + Y.^2) < Mask_radius;
S1 = abs(U_real.^2);
S2 = abs((Mask.*abs(fft_U)).^2);
It works but it is not very classy :s.
Result with the code :
댓글 수: 1
Ali Dordaee
2019년 10월 31일
Could you please send me the whole coding if you have fixed it? I really appreciate it. this is my Email:
alidordaee@gmail.com
If you want, you can also send the coding as my answer on this website. thanks so much.
답변 (2개)
Image Analyst
2016년 3월 22일
There is nothing wrong or unclassy about that code, except that you don't need the outer abs on S2. There are alternative ways of getting the same thing but they're not necessarily better, like
S2 = abs(fft_U); % Initialize
S2(~Mask) = 0; % Erase outside Mask
S2 = S2 .^ 2; % Square.
댓글 수: 2
Image Analyst
2016년 3월 23일
What does "take" mean? I can think of only two things: erase outside of it (which we've done), or to crop it out to its own image, which you can do by indexing or by using imcrop().
Tanweepriya Das
2018년 8월 9일
was the problem solved finally?
댓글 수: 1
Image Analyst
2018년 8월 9일
Evidently not or else he would have marked my answer as "Accepted". Plus he never answered my question about what he means by take. However I doubt he's still working on it after 2 years.
참고 항목
카테고리
Help Center 및 File Exchange에서 Financial Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!