Draw a graph by selecting relevant information

1 view (last 30 days)
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?

Accepted Answer

Stephen23
Stephen23 on 23 Jan 2015
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 Comments
Stephen23
Stephen23 on 25 Jan 2015
Edited: Stephen23 on 25 Jan 2015
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 on 26 Jan 2015
Stephen- thank you so much for your response.

Sign in to comment.

More Answers (0)

Categories

Find more on Line Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!