看板 MATLAB 關於我們 聯絡資訊
各位大大好,目前寫了一個資料處理的GUI,想要從畫出來的plot(x,y)上面,讓user用滑 鼠拖曳擷取某一區間,例如x(15:70),然後獲得區間內的平均值mean(y(15:70)), 任何關鍵字都好,謝謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.137.253.0 ※ 文章網址: https://www.ptt.cc/bbs/MATLAB/M.1503385030.A.B4E.html
YoursEver: rect = getrect( fig ); <== Can it work? 08/22 15:25
profyang: ginput 08/22 15:37
YoursEver: ginput collects only points, but getrect can specif 08/22 15:50
YoursEver: specify a rectangle region. 08/22 15:50
YoursEver: Oops, I see. "ginput" also works in this case. 08/22 16:03
YoursEver: google: subsetting a graphics image (cropping), Mat 08/22 16:04
YoursEver: Matlab. 08/22 16:04
l60km: 感謝兩位,both works,ginput用點選的、getrect用拖曳的。 08/22 16:17