Assuming you have a name vector in MATLAB named names
, you can add a '1' to the end of each name using the following code:
main.m66 chars4 lines
This code loops through each name in the names
vector and adds a '1' to the end of the name using the strcat
function, which concatenates two strings. The resulting modified name is then stored back into the same names
vector in the i
th index.
gistlibby LogSnag