How can I concatenate 3 strings using the value of a variable inbetween
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hugo
am 5 Sep. 2021
Beantwortet: Walter Roberson
am 5 Sep. 2021
Hi,
I have two strings:
string1='John'
string2='Maria'
I would like to write the following to an external file, called stringtext.txt
John,1,Maria
John,2,Maria
John,3,Maria
John,4,Maria
John,5,Maria
How can I do it in MATLAB?
I thank you in advance,
Best regards,
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 5 Sep. 2021
string1='John'
string2='Maria'
string1 + "," + string(1:5).' + "," + string2
0 Kommentare
Weitere Antworten (0)
Siehe auch
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!