- #1
sami-rehman
In the backdrop of my final year project i have a MATLAB question to ask you. Suppose we have text file placed in the
workspace of matlab. In the text file is written the address of a person. From that address i have to extract the city
name that is supposed to be writtent in the end. I can extract the city name if it is writtent right at the top of the
address but that's not how actual addresses are written.
My project is Automatic Mail Sorting Machine, after extracting the city name letters would be sorted out...
I am using the following code to address this apparamtly small issue :
%load ('string')
fid = fopen('string.txt')
%fseek(fid, 1, 'eof');
fseek(fid, 0,'eof');
C = textscan(fid,'%n %n% s',1);
%c=fscanf(fid,'%e',[4,inf]);
city=C{:}
%sam=cell2mat(city);
fclose(fid);
%display(sam)
textscan command is of importance here...if city name is written in the third line than the code must skip to the third line
but it yeilds error...text file name is "string"
please help ...
workspace of matlab. In the text file is written the address of a person. From that address i have to extract the city
name that is supposed to be writtent in the end. I can extract the city name if it is writtent right at the top of the
address but that's not how actual addresses are written.
My project is Automatic Mail Sorting Machine, after extracting the city name letters would be sorted out...
I am using the following code to address this apparamtly small issue :
%load ('string')
fid = fopen('string.txt')
%fseek(fid, 1, 'eof');
fseek(fid, 0,'eof');
C = textscan(fid,'%n %n% s',1);
%c=fscanf(fid,'%e',[4,inf]);
city=C{:}
%sam=cell2mat(city);
fclose(fid);
%display(sam)
textscan command is of importance here...if city name is written in the third line than the code must skip to the third line
but it yeilds error...text file name is "string"
please help ...