Functions - How to use?
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
Let me begin by adding the disclaimer that I am very new to MATLAB. I downloaded a function from the file exchange, called 'power law, exponential and logarithmic fit' that I would like to use. However I am confused as to how to use a function like this after downloading it. It presents itself as an .m file, however when I open and run it, I receive an error that notifies me that x isn't defined. Yet when I attempt to define x I receive another error that states that 'function definitions are not permitted at the prompt or in the scripts'. If someone would please just push me in the right direction or offer me some literature that I can utilize to further my knowledge in this rather powerful program, I would greatly appreciate it. Thank you.
댓글 수: 0
답변 (2개)
Oleg Komarov
2011년 8월 13일
You have to put the .m file in a separate directory. I have a directiry called FEX.
Then you have to add that directory to the search path:
File > Seth Path > Add folder
After that you can call the function as you would do with any other one.
out = myFEXfunc(firstInput, another,...)
The correct syntax is usually indicated by the function's help:
help yourfunction
doc yourfunction
댓글 수: 0
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!