필터 지우기
필터 지우기

Draw a graph by selecting relevant information

조회 수: 3 (최근 30일)
Chathu
Chathu 2015년 1월 23일
댓글: Chathu 2015년 1월 26일
I want to draw a distribution graph.
The issue is i need to select the values from a huge set of data.
eg; x= time Difference(1s,2s), y=frequency(1s-->No's , 2s --> No's)
Portion of the values which i need to get extracted:
time Difference =
0.1002
0.0992
0.1001
0.1003
0.0992
0.1002
0.0992
0.1002
0.1002
0.0992
0.1003
0.1002
0.0992
0.1002
.
.
.
How to select the relevant data and plot the graph?

채택된 답변

Stephen23
Stephen23 2015년 1월 23일
Maybe histogram (or hist for older versions) does what you want.
But actually your description is not clear: please explain what you mean by "time Difference(1s,2s)". You have not really told us the conditions by which you need to select the data.
  댓글 수: 4
Stephen23
Stephen23 2015년 1월 25일
편집: Stephen23 2015년 1월 25일
MATLAB is great for this kind of problem, because what you wrote in your explanation is almost the right syntax for the MATLAB code. The only thing to keep in mind is that you cannot perform two logical comparisons simultaneously: A<X<B has to performed as two operations A<X & X<B. So to get your desired output try something like this:
chkA = 0.1001<=timeD & timeD<=0.1002;
I also seriously recoomand that you look at using histc ( or histcounts for newer versions), which given a vector of bin edges counts all of the values in each bin for you!
Chathu
Chathu 2015년 1월 26일
Stephen- thank you so much for your response.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by