Help adding external functions
Mostra commenti meno recenti
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 Commenti
Voss
il 10 Dic 2021
Can you please post the complete text of the error/warning message(s) you get?
Walter Roberson
il 10 Dic 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
il 11 Dic 2021
Walter Roberson
il 11 Dic 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.
Risposta accettata
Più risposte (1)
Chunru
il 11 Dic 2021
0 voti
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.
Categorie
Scopri di più su Entering Commands in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!