I have a celll u(5,1) that looks like :
u{1,1}=''ART1/TEACH''
u{2,1}=''H0ME/SHOW''
I want to remove the first 5 characters from each of these strings so that in MATLAB:
u{1,1}=''TEACH''
u{2,1}=''SHOW''
How can I do it?
Here is the code
====================================================================
u
={"ART1/TEACH";"H0ME/SHOW123";"ART2/TEACHES";"H0ME/SHOW12";"ART4/TEACHER"};
for i = 1: length(u)
s = u{i,1};
u{i,1} = s(6:length(u{i,1})); % slice the string from position 5 to
last index and store at the same index
end
% display all the string
for i = 1: length(u)
s = u{i,1};
disp(u{i,1});
end
===============================================================
Get Answers For Free
Most questions answered within 1 hours.