MATLAB: Replace character with another

charactercodecommandMATLABpeclacestring

Hello.
Which command should I use in order to replace one character with another?
(For example in the word: Big, I would like to replace character i with a.)

Best Answer

S = 'Big'
S = 'Big'
S(S == 'i') = 'a'
S = 'Bag'
T = 'Big'
T = 'Big'
T = strrep(T, 'i', 'a')
T = 'Bag'
U = 'Big'
U = 'Big'
U = regexprep(U, 'i', 'a')
U = 'Bag'