How to put names of events in a listed vector?

1 次查看(过去 30 天)
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.

采纳的回答

James Tursa
James Tursa 2014-7-3
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by