作者l60km (/hr)
看板MATLAB
標題[討論] 如何從plot上面用滑鼠擷取某範圍資料
時間Tue Aug 22 14:57:08 2017
各位大大好,目前寫了一個資料處理的GUI,想要從畫出來的plot(x,y)上面,讓user用滑
鼠拖曳擷取某一區間,例如x(15:70),然後獲得區間內的平均值mean(y(15:70)),
任何關鍵字都好,謝謝!
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.137.253.0
※ 文章網址: https://webptt.com/m.aspx?n=bbs/MATLAB/M.1503385030.A.B4E.html
1F:推 YoursEver: rect = getrect( fig ); <== Can it work? 08/22 15:25
2F:推 profyang: ginput 08/22 15:37
3F:→ YoursEver: ginput collects only points, but getrect can specif 08/22 15:50
4F:→ YoursEver: specify a rectangle region. 08/22 15:50
5F:→ YoursEver: Oops, I see. "ginput" also works in this case. 08/22 16:03
6F:→ YoursEver: google: subsetting a graphics image (cropping), Mat 08/22 16:04
7F:→ YoursEver: Matlab. 08/22 16:04
8F:→ l60km: 感謝兩位,both works,ginput用點選的、getrect用拖曳的。 08/22 16:17