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

조회 수: 2 (최근 30일)
this is about classify text document

채택된 답변

KSSV
KSSV 2016년 12월 5일
clc; clear all;
stp_w={'is','the'}; % set of strings is and the
f = 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 file
for(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 if
end
  댓글 수: 1
hiba rashed
hiba rashed 2016년 12월 5일
thanks a lot and I want to find how many times repeated the word in gg.txt
if it does not stop word
and gg.txt
contain this
I live in a city called hilla
this city located in the center of iraq
it is not too large.hilla contain many resturants
in here road.these resturants make very good and delicious
food.one of city that nearby called najaf.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for Parrot Drones에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by