MATLAB Answers

Leah
1

how do you make an array with letters

Asked by Leah
on 16 Jul 2012
is there a function where instead of typing, A B C D E F .... there is a function that automatically makes an array from A through P?

  0 Comments

Sign in to comment.

3 Answers

Answer by Wayne King
on 16 Jul 2012
Edited by Wayne King
on 16 Jul 2012

Use char() with the ascii codes
char(65:70)
You may have to be aware of the locale settings though:

  1 Comment

MATLAB is not supported on any system which does not have the capital Latin Alphabet letters consecutive to each other.
I do find fragments of hints that MATLAB might have been able to read EBCDIC files at one time (R14 timeframe), but it appears that MATLAB itself has only ever run on ASCII and ISO 8896-* and Unicode systems.
This rule only applies to the Latin Alphabet (letters used in English); alphabetic characters outside those might appear in strange orders.
Also, this ordering is not imposed by the C programming language, which requires only that '0' to '9' be consecutive.

Sign in to comment.


Answer by Walter Roberson
on 16 Jul 2012

'A':'P'

  0 Comments

Sign in to comment.


Answer by Ryan
on 16 Jul 2012
Edited by Ryan
on 16 Jul 2012

letters = 'A':'P'; % According to this nifty iPhone Matlab Mobile app

  0 Comments

Sign in to comment.