Windowing and extracting data from a plot by selecting a zone

조회 수: 1 (최근 30일)
Sai Gudlur
Sai Gudlur 2018년 12월 14일
댓글: Sai Gudlur 2018년 12월 15일
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
Walter Roberson
Walter Roberson 2018년 12월 15일
Picture did not get attached?
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