Question about toolbox dependencies

Hello
I am working on getting a program ready for distribution and wanted to check on the required toolboxes. I noticed that when I run:
[fList,pList] = matlab.codetools.requiredFilesAndProducts('myprog.m');
It says that I need the Statistics and Machine Learning Toolbox. I have the toolbox installed, but do not want/need to require its use in the program. I did some digging and it seems that the iqr function is saying it requires this toolbox. However it seems as if although there is a iqr function in the statistics and machine learning toolbox, regular Matlab has a standard iqr function as well, which is the function I am using.
To illustrate this if I make a file test.m that has this code:
x = [1 2 3 4 5 6];
d = iqr(x);
and then I run
[fList,pList] = matlab.codetools.requiredFilesAndProducts('test.m');
{pList.Name}'
ans =
2×1 cell array
{'MATLAB' }
{'Statistics and Machine Learning Toolbox'}
Why does this happen?
Similarly, ive notived that 'Polyspace Bug Finder' is showing up as a required product. Ive never used this and have no idea why it would be required (although if I check pList.Certain for this it is 0). Can someone explain why this is being listed as a required product for my program?
thanks!

 Risposta accettata

Steven Lord
Steven Lord il 2 Feb 2023
Modificato: Steven Lord il 2 Feb 2023
The behavior you described for iqr is not a bug.
The Version History on the documentation page for the iqr function in MATLAB for numeric data states "R2022a: Moved to MATLAB from Statistics and Machine Learning Toolbox". This question was tagged R2020b and in that release iqr was part of and did require Statistics and Machine Learning Toolbox. There is another iqr in MATLAB that was introduced prior to release R2020b, but that is the iqr method for timeseries objects.
I'm not sure about the Polyspace Bug Finder behavior you described. Can you show a segment of code that lists this product when you try to determine its dependencies?

3 Commenti

Thanks! this is the explanation.
In terms of the polyspace bug finder, I am not sure how to find a segment of code that is using it. When I run
[fList,pList] = matlab.codetools.requiredFilesAndProducts('myprog.m');
{pList.Name}'
I get this:
{'MATLAB' }
{'Signal Processing Toolbox' }
{'Deep Learning Toolbox' }
{'Image Processing Toolbox' }
{'Statistics and Machine Learning Toolbox'}
{'Wavelet Toolbox' }
{'Parallel Computing Toolbox' }
{'MATLAB Parallel Server' }
{'Polyspace Bug Finder' }
Im not sure how to further investigate where the polyspace bug finder is operating - I didn't even know I had it...Can you point me in the direction to get the information you need?
thanks!
I haven't seen this behavior and searching for "requiredFilesAndProducts" on the Bug Reports for release R2020b didn't show anything that looks relevant.
I recommend sending your myprog.m file to Technical Support directly using the Contact Support link under the Get Support heading at the end of this page. They can investigate with the developers why Polyspace Bug Finder is listed as a potentially required product for your program.
Thanks
Whats weird is that I checked and dont think I even have the polyspace bug finder (I dont ever remember installing it and its not listed as a toolbox). Im going to finally upgrade to r2022 given the above issue with IQR and will see if maybe that resolves the problem. Will report back once I have upgraded. Thanks for your time looking into this!

Accedi per commentare.

Più risposte (1)

I think you've found a bug. Report it to the Mathworks or see if they already reported this.
I tried your example in R2020b and R2022b. Both versions have "Statistics and Machine Learning Toolbox" installed and licensed.
In R2020b, it showed
>> {pList.Name}'
ans =
2×1 cell array
{'MATLAB' }
{'Statistics and Machine Learning Toolbox'}
In R2022b, it showed
>> {pList.Name}'
ans =
1×1 cell array
{'MATLAB'}

Categorie

Prodotti

Release

R2020b

Richiesto:

HpW
il 2 Feb 2023

Commentato:

HpW
il 2 Feb 2023

Community Treasure Hunt

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

Start Hunting!

Translated by