selecting region of plot for calculations

11 ビュー (過去 30 日間)
ALDO
ALDO 2020 年 8 月 27 日
コメント済み: ALDO 2020 年 9 月 8 日
Hi
I have a signal 24 hours long. I would like to plot the signal over time sampling rate 0.97samples/sec. then select a region on that plot, have that selected region show as a sub plot. then i can press a button and do the calculations i want on it(min max,slope of decline,...) and show the results in a box next to the graph. If a new region of the original plot is selected it will erase the prevoius subplot and calculations with the new slected region and allow for new calculation. I would appriciate and input on this. I tried making a gui a few times and it gets confussing after a point and i get stuck. Thank you in advance for your help!
please let me know if further explanation is needed.
y data range 50:100
  11 件のコメント
Mario Malic
Mario Malic 2020 年 9 月 5 日
編集済み: Mario Malic 2020 年 9 月 5 日
In case you decide for the App Designer, here's a small start.
I somehow managed to get the x and y values of plots, see the windows button up/down callback. It's not so far from what you want to do.
ALDO
ALDO 2020 年 9 月 8 日
Hi Mario Thank you for taking the time to make the layout for the app designer, I really appriate your help and input. I will try to see if I can work using this. All the best!

サインインしてコメントする。

採用された回答

Ayush Bansal
Ayush Bansal 2020 年 9 月 3 日
  1. WindowButtonDown callback function is triggered when mouse button is clicked. Get the current position (i.e. (x,y)) of the pointer using CurrentPoint property of the axes to obtain the starting point of the region. Find the index (i.e. Istart) of the x using find function.
  2. WindowButtonUp callback function is triggered when mouse button is released and get the index (i.e. Iend) of the end point of the region as stated above.
  3. In the WindowButtonUp function to add new subplot change the initial plot to subplot using using UIaxes=subplot(m,n,p1,UIaxes) where UIaxes is name of the first axes. Then use ax2=subplot (m, n, p2) to add another subplot. Plot on the ax2 for the new data using plot (ax2, x(Istart:Iend), y(Istart:Iend)). Add button in the figure for the calculations.
  4. Use Slider ValueChangedFcn callback, triggered when slider is changed and get the Value property of slider to get the value of slider. Change the XData and YData property of all the plots accordingly.
  5. Add dropdown uicontrol and add a ValueChangedFcn callback function, change the XData, YData accordingly for all the plots.
  4 件のコメント
Ayush Bansal
Ayush Bansal 2020 年 9 月 4 日
I have made the necessary changes. I have added four subplots, WindowButtonDown callback, WindowButtonUp callback and slider. Callbacks can be added programmatically.
ALDO
ALDO 2020 年 9 月 4 日
Hi Ayush; Thank you so much for the time you took to correct the errors! I will try to go over every step and make sure to understand it fully. also If you have any suggested text for me to read to learn more about this it would be much appriciated. Thanks again for your help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by