Filter löschen
Filter löschen

Draw a graph by selecting relevant information

3 Ansichten (letzte 30 Tage)
Chathu
Chathu am 23 Jan. 2015
Kommentiert: Chathu am 26 Jan. 2015
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?

Akzeptierte Antwort

Stephen23
Stephen23 am 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 Kommentare
Stephen23
Stephen23 am 25 Jan. 2015
Bearbeitet: Stephen23 am 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 am 26 Jan. 2015
Stephen- thank you so much for your response.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by