Plotting histogram in years like BCE, CE
Afficher commentaires plus anciens
I want to plot a histogram of frequency of eruptions based on the years.
However, the data provided is not so simple. It has year in the form of BCE and CE, along with "unknowns". I want to get rid of the unknowns and count the number of eruptions. However, I cannot read the data as an integer/etc as there are strings in it. "500 CE" and "205 BCE" for example. Is there a way to plot the histogram accounting for such data? I have attached a photo of the data sample in the link.
So far, what I have is
% Locating the index for unknowns
ridunknowns = find(strcmp('Unknown',eruptyear));
% Changing the values of Unknowns to NaN in the vector
eruptyear([ridunknowns]) = {NaN};

Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Histograms dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!