MATLAB: How to make multiple strings arrays of repeating word and number

string array

I need to make an array that is like this:
["var1","var2","var3",…,"var18"]
the size of the array may change (larger or smaller than 18). How can I do that sytematically (not repeating or wiritng each individual array member)?

Best Answer

n = 18;
"var" + (1:n)