finding the string from the text file

조회 수: 43 (최근 30일)
msp
msp 2013년 4월 18일
댓글: Mira Mamdouh 2019년 12월 23일
i want to find the string from the given text file.
Example file contains : Hello welcome matlab tutorial.
if input is matlab, it should search the word(string) from the file if matched out put should string present in file else string doesn't present in the file.
  댓글 수: 2
msp
msp 2013년 4월 18일
Please Help Me with source code
Cedric
Cedric 2013년 4월 18일
편집: Cedric 2013년 4월 18일
Here is the best help that I can provide you with, accounting for your other questions:
In the "MATLAB" section, you will find the following documents:
  • PDF labeled "MATLAB Primer".
  • PDF labeled "Mathematics".
  • PDF labeled "Programming Fundamentals".
After reading these and training so you have a fair understanding of the material, you'll be able to do much more by yourself without asking for "(complete) source code".

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

답변 (3개)

Matt Kindig
Matt Kindig 2013년 4월 18일
To get you started, look at the documentation for the following functions:
doc strfind %to find whether a string is present
doc fileread %to read a text file all at once into a variable

Mahdi
Mahdi 2013년 4월 18일
편집: Mahdi 2013년 4월 18일
A=fileread(filename)
B=strfind(A, WordString)
I would suggest looking at the strfind() function for more information.
  댓글 수: 1
Mira Mamdouh
Mira Mamdouh 2019년 12월 23일
does it work properly if the microsoft file contains macros ?

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


msp
msp 2013년 4월 18일
any source code available?
  댓글 수: 1
Matt Kindig
Matt Kindig 2013년 4월 18일
Mahdi and I just gave you functions to get you started. What further source code do you need? Keep in mind that this forum will not simply write code for you (especially because this seems a lot like homework).

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

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by