Effacer les filtres
Effacer les filtres

Question re/ matlab.cod​etools.req​uiredFiles​AndProduct​s function.

12 vues (au cours des 30 derniers jours)
Prabhakar Vallury
Prabhakar Vallury le 11 Juin 2024
I have a Matlab app folder containing .m and .mlapp files to analyze and modify some automotive control modelsl. I tried using the function 'matlab.codetools.requiredFilesAndProducts'. It produces a long list of toolboxes, several of them seem very strange, e.g., Simbiology, Financial, Polyspace Bug Finder, etc. which don't seem relevant to anything I am trying to do.
When I run the app and check what's being used with license("inuse"), only a few toolboxes show up and none of these strange ones shown above. What am I missing? Is there a way to properly interpret the dependency output of the function that I need to do? Thanks for any guidance.
PV

Réponses (1)

Arthur Goldsipe
Arthur Goldsipe le 12 Juin 2024
I'd first check the "Certain" field of the pList output to see if these products have been marked as definitely or just possibly required.
When you run the app, you may not execute every line of code. So that may overlook some of the product dependencies. So I generally expect matlab.codetools.requiredFilesAndProducts to provide a more complete answer. However, the dynamic nature of the MATLAB language means that it is sometimes difficult to analyze these dependencies with 100% accuracy. For product dependencies, you can look at the Certain field to see whether this is a definitive or just a potential depdency.
I'm not sure of this, but I am guessing that some of these unexpected (potential) product dependencies arise when your code has a variable or function name that happens to match the name of a function in another product. If you want a definitive answer for why specific products are being flagged as dependencies, I suggest sharing reproduction steps either here or with MathWorks Technical Support.
Hope that helps!
  3 commentaires
Arthur Goldsipe
Arthur Goldsipe le 13 Juin 2024
I'm afraid I can't offer much more guidance myself. I wasn't aware of dependencies.toolboxDependencyAnalysis. The documentation is a little unclear (and I'll report that concern to our doc team), but here's what I can say: This is a function that ships with Simulink, and one of the examples on the reference page show that this function can tell you the product dependencies of a Simulink model. But it looks like it can also analyze dependencies of MATLAB function files. So there does seem to be some overlap of functionality with matlab.codetools.requiredFilesAndProducts. But my guess is that you mostly want to use matlab.codetools.requiredFilesAndProducts to analyze MATLAB code, and dependencies.toolboxDependencyAnalysis to analyze Simulink models.
Hopefully someone else who is more knowledgable will see this question and chime in. But if you want a definitive followup, you may have to contact MathWorks Technical Support.
Prabhakar Vallury
Prabhakar Vallury le 13 Juin 2024
What makes me a bit nervous is that 'matlab.codetools.requiredFilesAndProducts' seems to find toolboxes in non-Matlab files, e.g., a simple, unrelated text-files or Word documents, even. Whereas 'dependencies.toolboxDependencyAnalysis' seems to do a better job, returning empty on such files.
I'll check-in with Tech Support. Thanks for the guidance.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by