필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How do I save plot with specified x and y limits?

조회 수: 1 (최근 30일)
Viron Gil Estrada
Viron Gil Estrada 2018년 3월 22일
마감: MATLAB Answer Bot 2021년 8월 20일
I am trying to plot a pattern but it is located in the middle of an image and it is very small so I adjusted the x and y limits to show a closer view. Here is a part of my code below:
DP =fftshift(fft2(some_image));
DM = abs(DP).^2;
figure (1)
imshow(DM)
figure (2)
b = zeros(2048); % b is same with some_image, just with better resolution
b(2048/2-256:2048/2+255,2048/2-256:2048/2+255) = DM(1:2:end,1:2:end);
CD = abs(fftshift(fft2(b))).^2;
imagesc(CD)
axis([2048/2-128 2048/2+127 2048/2-128 2048/2+127])
imwrite(mat2gray(CD),'image.bmp')
The code worked fine but when I try to save the final image, it saved the image that is not axis adjusted. How do I save the executed image with a specified x and y limits?
Thanks,
  댓글 수: 1
KSSV
KSSV 2018년 3월 22일
Try with saveas

답변 (0개)

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by