필터 지우기
필터 지우기

How do I find the first 30 percent of each period of cosine?

조회 수: 1 (최근 30일)
wobbly
wobbly 2021년 9월 9일
댓글: Walter Roberson 2021년 9월 10일
I want to find and plot points of the graph with the find function to locateeach period of the cosine , how would i go about this?
  댓글 수: 4
Rik
Rik 2021년 9월 10일
I recovered the removed content from the Google cache (something which anyone can do). Editing away your question is very rude. Someone spent time reading your question, understanding your issue, figuring out the solution, and writing an answer. Now you repay that kindness by ensuring that the next person with a similar question can't benefit from this answer.

댓글을 달려면 로그인하십시오.

답변 (2개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 9월 9일
편집: Sulaymon Eshkabilov 2021년 9월 9일
In this case, if you are working and need to work with your plot, then you should work with ginput to locate where your full period is and then pick up the 30% of the data along x - axis. E.g:
[x, y] = ginput(5); % 5 points catch 4 periods. Click 1 picks up the starting point, click 2 end of 1st period, click 3 the end of 2nd period, etc.
% Then process the slected data with logical indexing (T is your known time signal along x axis):
T1 = T(T>=x(1) & T<=x(2));
T2 = T(T>=x(2) & T<=x(3));
...
% Then you can process the chosen data T1, T2, ... by reselecting only 1/3
% or 30% of it

Walter Roberson
Walter Roberson 2021년 9월 9일
look for the places where sign(diff()) of the signal changes from positive to negative. If you do not have noise, then those are the peaks. The difference in indices tells you how long that cycle is, so you can calculate how many points is 30% there. Then you can extract that subset, such as into a cell array.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by