MATLAB: Replacing part of a string

strings

Hi,
I have a column with cells that have the following format: US313384RJ03(GP)
I want to replace "US" by 1032 and delete completely (GP). How can I do so?

Best Answer

A={'US313384RJ03(GP)','US313384RJ03(GP)'};
A=strrep(A,'US','1032');
A=strrep(A,'(GP)','');