Enter same string in an array.
24 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Akashdeep Kaur
am 16 Jul. 2022
Kommentiert: Akashdeep Kaur
am 16 Jul. 2022
hello, I would like to enter same string in an array. like:
Array1=[a,a,a,a,a,a]
Thanks.
0 Kommentare
Akzeptierte Antwort
Harshit Gupta
am 16 Jul. 2022
Hi, if your question is just about how to create an array of string, you can do it like this:
Array1 = ["a", "a", "a", "a", "a"]
Now if you want to repeat a single string multiple times to create an array, do it like this:
str = "a";
Array1 = repmat(str, 1, 5)
Refer to the documentation to know more: repmat
Hope this helps!
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical 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!