Section can't find private function
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Jean-Paul Rozestraten
le 16 Déc 2020
Réponse apportée : Isabelle Levy
le 17 Déc 2020
I've got a script that has been broken down into sections and which uses functions which I've put in a private/ folder. When running the entire script it can find the functions without problem, but when I run a single section, it gives me the error:
Undefined function 'createFit' for input arguments of type 'struct'.
Is this because MATLAB runs scripts and section differently?
0 commentaires
Réponse acceptée
Isabelle Levy
le 17 Déc 2020
Hi Jean-Paul,
Your observation is correct. To evaluate a section, the script must contain all the values it requires, or the values must exist in the MATLAB workspace. To learn more about evaluating code sections, you can visit the documentation page here: https://www.mathworks.com/help/matlab/matlab_prog/run-sections-of-programs.html
I hope this helps.
-Isabelle
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!