Swap number with a word
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi all,
I am wondering how I could swap a number in a vector with a word. I have a vector from 1 to 100 ( linspace(1,100) ) and am trying to replace every fourth number with a word "height". Any suggestion on how to do this?
Thanks.
0 Kommentare
Akzeptierte Antwort
Birdman
am 7 Mär. 2018
a=string(linspace(1,100));
a(4:4:end)=regexprep(a(4:4:end),'\d*','height')
0 Kommentare
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Migrate GUIDE Apps 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!