Windowing and extracting data from a plot by selecting a zone

1 view (last 30 days)
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 Comments
Sai Gudlur
Sai Gudlur on 15 Dec 2018
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.

Sign in to comment.

Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!