Help adding external functions
Ältere Kommentare anzeigen
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 Kommentare
Voss
am 10 Dez. 2021
Can you please post the complete text of the error/warning message(s) you get?
Walter Roberson
am 10 Dez. 2021
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
am 11 Dez. 2021
Walter Roberson
am 11 Dez. 2021
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.
Akzeptierte Antwort
Weitere Antworten (1)
Chunru
am 11 Dez. 2021
0 Stimmen
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.
Kategorien
Mehr zu Entering Commands finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!