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

6 次查看(过去 30 天)
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

回答(2 个)

Arthur Goldsipe
Arthur Goldsipe 2024-6-12
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 个评论
Arthur Goldsipe
Arthur Goldsipe 2024-6-13
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 2024-6-13
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.

请先登录,再进行评论。


Chris Dixon
Chris Dixon 2024-10-3
What does the ProductNumber field signify? I cannot find any information on it. Is it the number of functions used within that toolbox?
  1 个评论
Arthur Goldsipe
Arthur Goldsipe 2024-10-3
ProductNumber is a unique number that MathWorks assigns to each product. I'll report to our documentation team that this needs to be documented.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by