Help adding external functions
이전 댓글 표시
Whenever I try to add an external function to my script (written as "external functions: X, Y, Z"), my script keeps syaing that these functions are unrecognized, despite the scripts working on their own even when plugged directly into the main script. If anyone knows how to get these external scripts to run, I would appreciate it
댓글 수: 4
Voss
2021년 12월 10일
Can you please post the complete text of the error/warning message(s) you get?
Walter Roberson
2021년 12월 10일
At the moment I do not recall anywhere that uses the syntax "external functions: " followed by a list ?
Could you clarify what it is you are doing, perhaps posting a link to the documentation for that aspect ?
Anthony Koning
2021년 12월 11일
Walter Roberson
2021년 12월 11일
Lines beginning with % are just comments. That bit about External Function is there as documentation.
function statements cannot be executed at the command line.
If you have an old enough version of MATLAB, then functions cannot occur inside of "script" files either. Files that are .m files that do not start with the word function or classdef are considered "script" files.
채택된 답변
추가 답변 (1개)
Chunru
2021년 12월 11일
0 개 추천
MATLAB has no external function like c and other languages. It relies on "path" to figure out the external functions. You can still put a comments for external functions to indicate that the current function relies on some other functions.
MATLAB also has more advanced features for managing the data and functions for a project. Search "Projects" in dcouments for more info. If you want to put your software into a better management, refere to class and packages.
카테고리
도움말 센터 및 File Exchange에서 Entering Commands에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!