Create an string array with strings having both char and numbers
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Vinay Killamsetty
am 8 Jun. 2021
Kommentiert: Vinay Killamsetty
am 12 Jun. 2021
Could you help me in creating a string array with strings containing characters and numbers in a sorted manner
Eg:
I want to create a string array with strings {"Analysis_1", "Analysis_2", "Analysis_3", "Analysis_4", ......, "Analysis_n"}
The values of 'n' should be defined in way that it can be varied by the user.
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Steven Lord
am 8 Jun. 2021
n = 5;
S = "Analysis_" + (1:n)
You can also use implicit expansion to make an array if you so desired.
fruits = ["apple"; "banana"; "cherry"]
quantity = 1:4;
market = fruits + "_" + quantity
Siehe auch
Kategorien
Mehr zu Environment and Settings 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!