Windowing and extracting data from a plot by selecting a zone

1 次查看(过去 30 天)
Hello Everyone,
Motive behind this question is it possible to have a movable window in a figure Where the user moves the window and acquires the desired range of data from a figure?
2) I have tried ginput (by defining 2 points) it does acquire the range of data selected by the user, but the issue in my case is i do not know how many cycles of data is acquired everytime. So would not know how many times do i have to loop ginput for the user to select new range of data everytime.
3)In the Code you would find Variable "Angle" which i haven't used anywhere reason being I want to plot Torque agnist a random x-axis. Select my zone/range have that selected range of torque data compared orginal Torque Data (To know the size of the extracted file) angle data here has the same size as Torque so Now the selected range of torque and its corresponding "Angle" could be written out into a excel file making in (nx2) Matrix.
Any Help would be appreciated. Also copying my code below and have attached a picture which explain what windowing i am talking about.
[filename,pathname] = uigetfile('*.xlsx');
fullfilename = fullfile(pathname,filename);
A = xlsread(fullfilename);
Torque = movmean(A(:,1 ),50);
Angle = movmean(A(:,2),50);
h = plot(Torque);
saveas(h,'All_Data.fig');
% hold on
%pts = ginput(2) ;
h = hgload('All_Data.fig');
get(h)
ch = get(h,'Children');
l = get(ch,'Children');
y = get(l,'ydata')
  2 个评论
Sai Gudlur
Sai Gudlur 2018-12-15
Hello Walter,
Sorry abt that have edited my question and attached picture to it. Also attaching a copy to this msg.
Thanks for your time and effort.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by