Hi, everyone. I have a surf plot which has 108*192 pixels (a f=tiff image converted to surf). I am only interested in the middle of the plot and I want to only show an area of say, x=1:10, 90:108 and y=1:10, 100:192. In other words, I want to remove everything outside of a square/circle (defined either by pixels or by interactively choosing it) in the middle.
Many thanks

댓글 수: 4

darova
darova 2020년 3월 21일
What is the problem?
Fakhraddin Akbari Dourbash
Fakhraddin Akbari Dourbash 2020년 3월 21일
The probelm is I do not know how to do this.
I am doing some process on the whole image and would like to get this surf plot with all of the pixels processed, but want to remove some parts from the final surf plot. While trying to do this, error comes up: "data dimentions must agree"
darova
darova 2020년 3월 21일
Can you show the code? And how are you trying to do this?
Fakhraddin Akbari Dourbash
Fakhraddin Akbari Dourbash 2020년 3월 21일
Sure, the last part of the code:
x = 1:108;
y = 1:192;
[X,Y]=ndgrid(x,y);
surf(X,Y,T,'EdgeAlpha',.1);
M=jet
colormap(M)
colorbar
T is a fucntion after processing all the pixels and gives me the height in the surf plot.

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

 채택된 답변

darova
darova 2020년 3월 21일

0 개 추천

Try this
x = 1:108;
y = 1:192;
[X,Y]=ndgrid(x,y);
ii = 90:108;
jj = 100:192;
surf(X,Y,T,'EdgeAlpha',.1);
alpha(0.5)
hold on
surf(X(ii,jj),Y(ii,jj),T(ii,jj))
hold off
M=jet
colormap(M)
colorbar

댓글 수: 1

Fakhraddin Akbari Dourbash
Fakhraddin Akbari Dourbash 2020년 3월 21일
Gives me exactly what I wanted. Thanks. Appreciate it.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Images에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by