Is it possible to determine when I last used a toolbox?

14 ビュー (過去 30 日間)
David K
David K 2017 年 5 月 3 日
回答済み: Dave Carrier 2018 年 6 月 7 日
It's coming time for me to renew my license, and I have a couple toolboxes that I rarely use, if at all. Is there a way to see when the last time a certain toolbox was used? If I haven't used it in over a year, I'm not going to renew it. I know I can use license('inuse') to determine which toolboxes are currently in use, but that doesn't help me determine if I ever use a particular toolbox.

回答 (3 件)

Jan
Jan 2017 年 5 月 4 日
編集済み: Jan 2017 年 5 月 4 日
You could check the file access dates with FEX: GetFileTime under Windows:
FileDir = dir(fullfile(matlabroot, '\**\*.*'));
NameList = cell(1, numel(FileDir));
DateList = zeros(numel(FileDir), 6);
for iFile = 1:numel(FileDir)
File = fullfile(FileDir(iFile).folder, FileDir(iFile).name);
NameList{iFile} = File;
DateList(iFile, :) = GetFileDate(File, 'UTC', 'Access');
end
Now you can get the last access of a specific folder, e.g. determined as parent folder of a specific function:
Folder = fileparts(which('nanmean'));
Match = strncmpi(NameList, Folder, length(Folder));
Dates = sortrows(DateList(Match, :));
LastAccess = Dates(1, :);
Unfortunately I'm nor sure if this works on your machine. The logging of the access dates can be disabled. Calling the help text of a function cannot be distinguished from using the toolbox. Therefore I would not use this as solution, but it might be a hint.
Note that this works only, if you have enables the last access logging. Check this at first:
fsutil behavior query DisableLastAccess
To enable the logging:
fsutil behavior set DisableLastAccess 0
Run these commands in Windows' command window with admin privileges. Logging the last access will slow down the disc access measurably.
  1 件のコメント
David K
David K 2017 年 5 月 4 日
This looks like it's the right approach, but I'm having some issues getting it working. First, dir with the recursive wildcards doesn't work; I can only operate in the current level. The dir output also doesn't provide a folder field. I managed a workaround by creating my own recursive search function and adding the folder field manually.
Is the function GetFileDate supposed to be GetFileTime? I only saw the one function on the FEX, but I haven't tried compiling it yet.

サインインしてコメントする。


Steven Lord
Steven Lord 2017 年 5 月 3 日
Check with your license administrator. Depending on the type of license you're using, they may be able to use the license management tools to gather this information.
  2 件のコメント
David K
David K 2017 年 5 月 3 日
I have an Individual license, not a Network license.
Andreas Goser
Andreas Goser 2017 年 5 月 4 日
If you have a stand-alone license, your toolbox usage is not logged.
Maybe you are in a situation where you do not use the toolboxes, because your project / application scope has changed. But maybe you could leverage the value of the toolboxes, but you need some technical information from a MathWorks engineer?

サインインしてコメントする。


Dave Carrier
Dave Carrier 2018 年 6 月 7 日
Kinda cumbersome but couldn't you cycle through your recent command history, find unique and successful script names then use:
names = dependencies.toolboxDependencyAnalysis({cell array containing script names})
Ugly, and slow... but might work.

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by