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');
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')