1

I have a project that is a single main app in app designer that i am using as a shell to call 3 matlab scripts and 7 app designer apps. I want to determine Toolbox dependency on the entire project, however the MATLAB documentation shows how to run dependency analysis on simulink models. I have used dependencies.toolboxDependencyAnalysis function on my matlab script files and app files but it only returns {'MATLAB'} . So is there a way to run toolbox dependency analysis in matlab for app designer ?

sk95
  • 23
  • 3
  • The [`getcallinfo`](http://undocumentedmatlab.com/articles/function-definition-meta-info/#getcallinfo) function may be useful (but beware, it's not documented); see [here](https://stackoverflow.com/a/46360465/2586922) – Luis Mendo Mar 05 '20 at 16:33
  • Based on your description I am not sure about what you are trying to achieve -- what other toolbox do you expect to see? Why do you mention Simulink when it seems irrelevant in your question? Also, try [matlab.codetools.requiredFilesAndProducts](https://www.mathworks.com/help/matlab/matlab_prog/identify-dependencies.html) – Zhe Mar 05 '20 at 17:59
  • I am trying to find the toolboxes that my project requires to run using the dependency analysis as shown in matlab documentation in the link (https://www.mathworks.com/help/simulink/ug/perform-impact-analysis.html#bve660a-1) , but this only works for projects in simulink and my project is in app designer – sk95 Mar 05 '20 at 19:55

1 Answers1

1

You can use the MATLAB function matlab.codetools.requiredFilesAndProducts to show all of the function dependencies and required toolboxes. For example, if you have two functions in separate files:

function a = testdep1(b)
    fprintf(1,'function testdep1\n');
    a(1) = b*2;
    a(2) = testdep2(a(1));
end

and

function c = testdep2(d)
    fprintf(1,'function testdep2\n');
    c = d/3;
end

then you can use:

[fList, pList] = matlab.codetools.requiredFilesAndProducts('testdep1')

to see the list of "program files" required (note this does not include sub-functions in the same file) and the toolboxes required.

fList =

  1×2 cell array

    {'/TEST/testdep1.m'}    {'/TEST/testdep2.m'}

pList = 

  struct with fields:

             Name: 'MATLAB'
          Version: '9.5'
    ProductNumber: 1
          Certain: 1
mhopeng
  • 1,063
  • 1
  • 7
  • 17