Hello - im new in here :)
I've got some kind of radar's signal that I want to show with the imagesc() function.
After an fft2 I wanted to show my signal with:
figure; imagesc(abs(tabsygn-mean(y,2)));
It all worked, however when I went to reduce my axis size, something strange happened. It changed the values, however the image itself didn't change. I've used the command below:
imagesc(0:200,250:400,(abs(tabsygn-mean(y,2))));
The image on the left is original, and on the right is after the command above.

댓글 수: 3

Image Analyst
Image Analyst 2017년 12월 15일
편집: Image Analyst 2017년 12월 15일
So you're wondering about how the black spec at row 320, column 740 is missing from the image on the left? Is that it? When you say the image itself, do you mean the displayed image or the underlying image variable?
Michal Karwacki
Michal Karwacki 2017년 12월 15일
No, black dot appearded when I exported the figure into jpg. I wonder how to cut out the yellow line and create image with y(150:450) and x(0:900) from the original image
Adam
Adam 2017년 12월 15일
The arguments you pass as x and y to imagesc to not change the image at all, they just give the values for the x and y data to put on the axes.
If you want to clip an image you do this in the normal way, after plotting it, using
doc xlim
doc ylim
or
doc axis

댓글을 달려면 로그인하십시오.

 채택된 답변

Image Analyst
Image Analyst 2017년 12월 15일

0 개 추천

Try
yourImage = abs(tabsygn-mean(y,2));
% Extract only rows 150-450 and columns 1-900.
yourImage = yourImage(150:450, 1:900);

댓글 수: 4

It's 2-D Matrix - there is an error with the code above.
if true
>> yourImage = abs(tabsygn-mean(y,2 ));
>> yourImage = yourImage(1:900, 150:450 );
Index exceeds matrix dimensions.
end
Adam
Adam 2017년 12월 15일
Well, you swapped around the indexing for some reason.
Michal Karwacki
Michal Karwacki 2017년 12월 15일
well i feel stupid now. It all worked - thanks a lot
Image Analyst
Image Analyst 2017년 12월 16일
Well, it's a common beginner mistake so you just joined thousands of other who do the same thing all the time.
Beginners think matrices are indexed m(x,y), but they are NOT.
They are indexed m(y, x) because rows are y and columns are x, and it's the rows that come first in the index list.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

질문:

2017년 12월 15일

댓글:

2017년 12월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by