Representing data from File !

1 vue (au cours des 30 derniers jours)
Susan
Susan le 31 Juil 2011
Hello Guys, I have a data in a file consists of two columns one for the arrival time and the other one for the Energy(ev).. I want to represent the data in the x-axes region so I will be able to estimate its function using kernel density function.. I am not sure how to represent the data in the x-axes though? I did once represent the data in the x-axes like a little dashes way and I used(repmat)but with this case I don't have any idea how to do so.. In this link there is an image and if you look at the x-axes you will see some dashes that are more in some area and less in another, thats exactly what I am looking for so I will be able to estimate its function later on..
Also, in my previously asked question you can see if you run it what I mean by "little dashes on the x-axes(red data))
Thank you all,
  3 commentaires
Susan
Susan le 31 Juil 2011
http://www.mathworks.com/matlabcentral/answers/4596-plot-spikes-in-matlab
If you run it you should be able to see what I mean"by the dashes in the x-axes" also, the link I put is for an image that could show you what I am expecting"only look in the dashes in the x-axes in the image"
Walter Roberson
Walter Roberson le 31 Juil 2011
duplicate is at http://www.mathworks.com/matlabcentral/answers/12733-plot-data-from-file

Connectez-vous pour commenter.

Réponse acceptée

Fangjun Jiang
Fangjun Jiang le 31 Juil 2011
Go back to your previous post. I saw similar dash in the figure. The answer is right there. The command to draw it is line().
Sa=0:0.2:2; %if your original data is column vector, transpose it.
line(repmat(Sa,2,1),repmat([0;1],1,length(Sa)),'color','r' );
axis([0 2 0 10]);
  9 commentaires
Fangjun Jiang
Fangjun Jiang le 31 Juil 2011
@Susan, you need to go back to the basics of MATLAB or programming in general. The line() command draws a line from one point to another point. In this example, it draws from (0,0) to (0,1), from (1,0) to (1,1), from (2,0) to (2,1) etc. The height is all 1. If you want to change the height, you can change the number accordingly. If you can't understand and see this, you need to go back to the basics.
Susan
Susan le 31 Juil 2011
Oh no, I get that and I understood it awhile ago.. Thanks !

Connectez-vous pour commenter.

Plus de réponses (1)

Jan
Jan le 31 Juil 2011
Do you want to represent the Energy or the arrival time in the X-axis? The small dashs at the bottom of the shown image represent just a binary signal versus time, e.g. the arrival times of detected signals. Therefore it is not clear, how you want the two data sets to be represented in a diagram. The small dashs with equal size simply do not match to your data.
  5 commentaires
Jan
Jan le 31 Juil 2011
set(gca, 'YLim', [0, 10])
Susan
Susan le 31 Juil 2011
I figured this way,I read the axes documentation and came up with this and it worked :)
a= min(n);
b=max(n);
axis([a b 0 30]);

Connectez-vous pour commenter.

Catégories

En savoir plus sur Geographic Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by