How can I calculate and show the average(mean) of the data show in zoom on an Axes GUI?
    2 ビュー (過去 30 日間)
  
       古いコメントを表示
    
I want every time you zoom in axes , calculating the average of the data shown in the zoom, and put it in a static text.
0 件のコメント
回答 (1 件)
  Julie
      
 2016 年 3 月 11 日
        
      編集済み: Julie
      
 2016 年 3 月 11 日
  
      Lets assume your data is x and y Whenever the zoom changes (I don't know how you are implementing your zoom but you may need to add a listener or something else)
xl = xlim %note you may need to use a get command here instead, I am not %100 sure how this will interact with the GUI 
%get(handles."your graph",'xlim')
yl=ylim
yt(x<xlim(1) | x>xlim(2) | y<ylim(1) | y>ylim(2))=[];
set(handles."Your Text box",'string',num2str(mean(yt))]
0 件のコメント
参考
カテゴリ
				Help Center および File Exchange で Data Exploration についてさらに検索
			
	製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!