How to put names of events in a listed vector?

3 vues (au cours des 30 derniers jours)
Shane
Shane le 3 Juil 2014
Commenté : Shane le 3 Juil 2014
I want to put names in a column vector like this: Event1 Event2 etc
The only way to can do this right now is if I make each event the same size using space bar (or a period because a spacebar wont show up in the question) like this: a=[event1..;event345;event45.;etc....];
As you can see they are all the same size. However, this is a problem because 1) it takes forever and 2) when it comes to plot these names, all the letters of a single name plot in the exact same area, making it unreadable if that makes sense. How do I change this? Thanks.

Réponse acceptée

James Tursa
James Tursa le 3 Juil 2014
Can you use a cell array of strings instead? E.g., {'event1','event345','event45', etc }. That way the strings do not need to be the same length with blank padding at the end. Also, several MATLAB functions work with cell arrays of strings as inputs.
  1 commentaire
Shane
Shane le 3 Juil 2014
Yup that worked. Thanks

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by