Matlab text file reading and passing o fnction

Status
Not open for further replies.

Waqas Mughal

Newbie level 4
Joined
Aug 5, 2010
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Islamabad
Activity points
1,308
Hello!
i need ur help urgently!

Iread my text file by the function text=fread('textfile.txt');

then i have to pass this data to my function in matlab which takes input as string but my string data read from text file is in a string.
but i have to pass string in my function as myfunction('TXT');


how i can solve this problem?

thanks in advance
 

Try fgetl or fgets to read a line as text.
 

can u tell me the code how to use fgetl or fgets.
i tried already but was unable o use!
 

The matlab help is your friend, try: "help fgetl" or "doc fgetl" for an example.
Maybe you want to read the whole file, try: text = fileread('your.file')
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…