필터 지우기
필터 지우기

Max peak between two points using ginput

조회 수: 4 (최근 30일)
Nathan
Nathan 2012년 5월 15일
Hello,
I am trying to find the max peak between two points on a graph, using ginput. In other words, I want to be able to pick two points and the program will tell me the max peak between those two points. Any advice?
Thanks,
Nathan
  댓글 수: 1
Thomas
Thomas 2012년 5월 15일
Do you want the difference between the peaks or just which one is the highest?

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

답변 (2개)

Thomas
Thomas 2012년 5월 15일
I dont know if this is what you are looking for?
c=rand(1,10) % generate some random data
plot(c) % plot the data
hold on
y=[];
y=ginput(2); % take two mouse inputs on the graph
[r,c,v]=find(y==(max(y(:,2)))); % find which one is higher
Peak=y(r,:) % output the highest value coordinates..
hold off

Image Analyst
Image Analyst 2012년 5월 15일
If you have the Image Processing Toolbox, use improfile to get the intensity profile on a line between those two points. Then just pass that profile into the max() function to get the max value and location of the max between those two point.

카테고리

Help CenterFile Exchange에서 Visual Exploration에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by