How to put names of events in a listed vector?

조회 수: 1 (최근 30일)
Shane
Shane 2014년 7월 3일
댓글: Shane 2014년 7월 3일
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