how to make an array of characters of variable length?

3 Ansichten (letzte 30 Tage)
rana karem
rana karem am 12 Jun. 2021
Beantwortet: Walter Roberson am 12 Jun. 2021
I want to make an array of unique characters or strings of variable length (n) e.g n=5. so I can't use 'a':'e' cause 'e' is not constant it depends on n which varies continuously ...I don't know the 'e' ....I just know that i want an array e.g from 'a' to a+n
Any help is highly appreciated. Thanks

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 12 Jun. 2021
n=5;
'a':char('a'+n-1)
ans = 'abcde'

Weitere Antworten (0)

Kategorien

Mehr zu Characters and Strings finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by