Max peak between two points using ginput
4 ビュー (過去 30 日間)
古いコメントを表示
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
2012 年 5 月 15 日
Do you want the difference between the peaks or just which one is the highest?
回答 (2 件)
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
0 件のコメント
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Visual Exploration についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!