Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

What's the best way to ensure that we're calling simulink project specific functions

1 visualizzazione (ultimi 30 giorni)
We are using simulink projects to split up our models - each project has a heirarchy of functions, mostly called the same thing in every project. For example, we have a top level set up function (set_up_project.m) which is called as a shortcut when the project is loaded. This function calls buses_load.m and configurations_load.m. However, when calling these functions I'm not sure that we're guaranteed to be calling the one for the project we're currently in, unless it either happens to be first on the path, or we're explicitly changing to the folder it's in before the call (and then changing back once it returns). Do we need to be putting controls around which version of the script is being called, and what's the best method of doing this?
  • Does MATLAB change the function call precedence order when Simulink projects are involved, e.g. by knowing which are the paths for the project, and searching these first (this isn't mentioned on https://au.mathworks.com/help/matlab/matlab_prog/function-precedence-order.html)
  • Is there a way of explicitly calling a function located in a specific folder?
  • Is there a way of setting the local directory of the function such that when it returns, the directory is unchanged (so we don't need to explicitly change back to the original directory before we return)?

Risposte (0)

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by