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

조회 수: 7 (최근 30일)
Prabhakar Vallury
Prabhakar Vallury 2024년 6월 11일
댓글: Arthur Goldsipe 2024년 10월 3일
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