MATLAB: How to remove (.) from strings in matlab about classify text document Best Answer Use strrep, which is designed to perform the task that you want:>> str = '.Hello.World.';>> strrep(str,'.','')ans = HelloWorld Related SolutionsMATLAB: How I can know if a string is empty or not! How about the helpfully named isempty?:>>isempty('aaa')ans = 0>>isempty('')ans = 1Note that because strings are just matrices (of characters), it's the same test you use for matrix emptiness. MATLAB: I didnot understand this code i want help stp_w={‘is’,’the’}; f = fopen(‘gg.txt’); I = textscan(f,’%s’,100);% d=I{1}; for(i=1:2) x = strmatch(d(i), stp_w) If x~=1 clc; clear all;stp_w={'is','the'}; % set of strings is and thef = fopen('gg.txt'); % gg.txt text file is opened I = textscan(f,'%s',100); % the data in the file is scanned, it scans into cells d=I{1}; % the first line data from the text filefor(i=1:2) % loop from 1 to 2 x = strmatch(d(i), stp_w) % trying to find wheter is/the exists in first line using strmatch(stringmatch) If x~=1 % if the word exists, goes inside ifend Related QuestionGetting index from strsplit or strfind in a null (00) terminated stringStrrep for more replacing using ifStrcat including space (i.e, ‘ ‘)Length of a stringAdd / before _ in a string
Best Answer