Function that has a text file as input

조회 수: 1 (최근 30일)
Meisam
Meisam 2012년 2월 29일
Hi I somehow know how to create a new function in matlab, while the function has NUMBERS as input. How can I define a Text file as input for my Matlab function? your answers really makes my life easier.

채택된 답변

Jan
Jan 2012년 2월 29일
What exactly do you mean by "text file"? The name or the contents of the file?
Both possibilities mean, that the input is a string, but in the first case, the input is treated as file name.
  댓글 수: 2
Meisam
Meisam 2012년 3월 9일
I will explain more,
I have a script , that I used the function fopen and text scan to open and read a text file. then i used the numbers inside the text file and created a XML file.
Now I want to do something like this
function xmlFilename=rob2xml(name of text file)
fid=fopen(text file)
textscan
fclose
some mathematical experesion
xmlFilename=[tempname,'.xml']
but it does not work
Jan
Jan 2012년 3월 9일
What did you do exactly and what does "it does not work" mean explicitely? Currently the description of the problems is too vague to allow a specific answer.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by