How do features from 'license' correspond to names from 'ver'
Mostrar comentarios más antiguos
I'm currently struggling a bit trying to set up a proper mechanism to check for the presence and availability of a matlab toolbox.
I know that using `ver`, I can get a list of all installed toolboxes in the name field of the resulting struct, and that using `license('test',featurename)` I can check, whether this toolbox is actually license (and can thus be used).
The problem is, that the names from `ver` do not clearly correspond to the feature strings used in `license` (e.g. 'Global Optimization Toolbox' becomes 'Optimization_Toolbox'). There is a list at https://nl.mathworks.com/help/matlab/ref/license.html which details a bunch of "Corresponding" feature / Product pairs, but since whats showing up in the name field changes between matlab versions, I don't want to rely on this.
Is there any programmatic way to find the corresponding values that is valid from at least 2014b?
1 comentario
Gareth
el 16 de En. de 2024
When I read this type of question, I wonder what is driving it? In my experience one reason is that people are trying to parse the license manager debug file to derive usage of the different toolboxes. If this is the case feel free to search for companies that do this: https://www.versionbay.com/products/toolbox-usage-analyzer-flexinspect/
Disclaimer: I work for the company that makes this product. That being said we created it just because there several organizations / people trying to do this, which probably is not their day job.
Respuesta aceptada
Más respuestas (6)
Julian Hapke
el 4 de Mayo de 2020
Editada: Julian Hapke
el 5 de Mayo de 2020
Here's what I use:
EDIT: Now all features known to the current release are listed, not only the installed ones.
function OUT = getFeatureName(fullname)
% getFeatureName - translates a toolbox name from 'ver' into
% a feature name and vice versa, also checks license availability
%
% Syntax:
% getFeatureName(fullname)
%
% Inputs:
% fullname: character vector of toolbox name as listed in ver
% output (optional, if none given all features are
% listed)
%
% Outputs:
% translation: cell array with clear name, feature name and license
% availability
%
%-------------------------------------------------------------------------
% Version 1.1
% 2018.09.04 Julian Hapke
% 2020.05.05 checks all features known to current release
%-------------------------------------------------------------------------
assert(nargin < 2, 'Too many input arguments')
% defaults
checkAll = true;
installedOnly = false;
if nargin
checkAll = false;
installedOnly = strcmp(fullname, '-installed');
end
if checkAll || installedOnly
allToolboxes = com.mathworks.product.util.ProductIdentifier.values;
nToolboxes = numel(allToolboxes);
out = cell(nToolboxes, 3);
for iToolbox = 1:nToolboxes
marketingName = char(allToolboxes(iToolbox).getName());
flexName = char(allToolboxes(iToolbox).getFlexName());
out{iToolbox, 1} = marketingName;
out{iToolbox, 2} = flexName;
out{iToolbox, 3} = license('test', flexName);
end
if installedOnly
installedToolboxes = ver;
installedToolboxes = {installedToolboxes.Name}';
out = out(ismember(out(:,1), installedToolboxes),:);
end
if nargout
OUT = out;
else
out = [{'Name', 'FlexLM Name', 'License Available'}; out];
disp(out)
end
else
productidentifier = com.mathworks.product.util.ProductIdentifier.get(fullname);
if (isempty(productidentifier))
warning('"%s" not found.', fullname)
OUT = cell(1,3);
return
end
feature = char(productidentifier.getFlexName());
OUT = [{char(productidentifier.getName())} {feature} {license('test', feature)}];
end
end
3 comentarios
Image Analyst
el 4 de Mayo de 2020
Very cool, Julian. Did you write that? I always wondered how they came up with those names, especially why the second name is not identical to the first name. For example: "Computer Vision Toolbox" is "Video_and_Image_Blockset"
I wrote this companion code which some might find useful for looking at their own toolboxes:
v = ver % Get all your version info into one variable.
for k = 1 : length(ver)
thisToolboxName = v(k).Name;
fprintf('Checking on %s..\n', thisToolboxName);
toolboxInfo = getFeatureName(thisToolboxName);
fprintf(' "%s" is "%s"\n', toolboxInfo{1}, toolboxInfo{2});
if toolboxInfo{3} == 1
fprintf(' You currently have a license to use %s.\n', toolboxInfo{1});
else
fprintf(' You do not currently have a license to use %s.\n', toolboxInfo{1});
end
end
For my 10 toolboxes, I get:
v =
1×10 struct array with fields:
Name
Version
Release
Date
Checking on Computer Vision Toolbox..
"Computer Vision Toolbox" is "Video_and_Image_Blockset"
You currently have a license to use Computer Vision Toolbox.
Checking on Deep Learning Toolbox..
"Deep Learning Toolbox" is "Neural_Network_Toolbox"
You currently have a license to use Deep Learning Toolbox.
etc.
Julian Hapke
el 5 de Mayo de 2020
Thanks :)
Yes, I did write that. I found the essential parts by stepping through
ver -support
Julian Hapke
el 5 de Mayo de 2020
Regarding the Names: I guess it's history. The license feature got the marketing name with underscores instead of whitespace but then marketing changed the feature name, but it stayed the same on the license service. E.g. https://web.archive.org/web/20000815202232/http://www.mathworks.com/products/
Then it was "Real-Time Windows Target", now it's "Simulink Desktop Real-Time" but the feature name was always "Real-Time_Win_Target".
Thomas Pfau
el 18 de En. de 2018
1 voto
Jan
el 18 de En. de 2018
You have to rely on something. Because this is not trivial, when the names or key changes, writing your own function might be the easiest way:
function hasToolbox = CheckToolbox(Feature)
persistent ExistingToolboxes
if isempty(ExistingToolboxes)
PrefFile = fullfile(prefdir, 'CheckToolbox.data');
if exist(PrefFile, 'file') % Preferences file is existing already:
FileData = load(PrefFile, '-MAT');
ExistingToolboxes = FileData.ExistingToolboxes;
else % Need to create new preferences file:
ExistingToolboxes = SelectToolboxesGUI({});
end
end
% Allow to open the GUI to select toolboxes manually:
if strcmpi(Feature, 'LetMeChoose')
ExistingToolboxes = SelectToolboxesGUI(ExistingToolboxes)
else
hasToolbox = any(strcmpi(Feature, ExistingToolboxes);
end
end
function ExistingToolboxes = SelectToolboxesGUI(ExistingToolboxes)
... A tiny GUI to select existing toolboxes ...
end
Now it is up to the user to find out, if the needed license are installed. You can add a list of known feature keys also for a useful error message, if somebody asks for the CrystalBall or DWIM toolboxes. But you cannot check, if there is a license available in case of concurrent licenses with this tool yet.
Well, the problem is not solved by this function. It was hard to check the Matlab version already, when they hopped from the R6.5 scheme to R2007b, and after the problems to distinguish version 7.1 and 7.10. Sometimes functions are moved from a specific toolbox to Matlab's standard toolboxes, and then a rejected check for a toolbox can be too strict, when a function could work.
Jerry George
el 18 de Jun. de 2019
Editada: Jerry George
el 18 de Jun. de 2019
You can use the following commands to list the features available as per your license:
text = fileread(fullfile(matlabroot,'licenses','license.dat'));
expression = '(?<=INCREMENT )\w*';
matches = regexp(text,expression,'match');
disp(matches');
1 comentario
Walter Roberson
el 18 de Jun. de 2019
The license files are not always in that location; see https://www.mathworks.com/matlabcentral/answers/99147-where-are-the-license-files-for-matlab-located and https://www.mathworks.com/help/install/ug/understanding-license-files.html
Qingyang Du
el 18 de Jul. de 2022
5G_Toolbox
Aerospace_Blockset
Aerospace_Toolbox
Antenna_Toolbox
Audio_System_Toolbox
Audio_Toolbox
Automated_Driving_System_Toolbox
Automated_Driving_Toolbox
AUTOSAR_Blockset
Bioinformatics_Toolbox
Bluetooth_Toolbox
CDMA_Reference_Blockset
Communications_Blockset
Communications_System_Toolbox
Communications_Toolbox
Computer_Vision_System_Toolbox
Computer_Vision_Toolbox
Control_System_Toolbox
Curve_Fitting_Toolbox
Data_Acquisition_Toolbox
Database_Toolbox
Datafeed_Toolbox
DDS_Blockset
Deep_Learning_HDL_Toolbox
Deep_Learning_Toolbox
Distributed_Computing_Toolbox
DO_Qualification_Kit
DSP_HDL_Toolbox
DSP_System_Toolbox
Econometrics_Toolbox
EDA_Simulator_Link
EDA_Simulator_Link_DS
EDA_Simulator_Link_IN
EDA_Simulator_Link_MQ
Embedded_Coder
Embedded_IDE_Link
Embedded_IDE_Link_CC
Embedded_IDE_Link_MU
Embedded_IDE_Link_TS
Embedded_IDE_Link_VS
Embedded_Target_for_Infineon_C166_Microcontrollers
Embedded_Target_for_Motorola_HC12
Embedded_Target_for_Motorola_MPC555
Embedded_Target_for_OSEK_VDX
Embedded_Target_for_TI_C2000_DSP
Embedded_Target_for_TI_C6000_DSP
Excel_Link
Extended_Symbolic_Math_Toolbox
Filter_Design_HDL_Coder
Filter_Design_Toolbox
Financial_Derivatives_Toolbox
Financial_Instruments_Toolbox
Financial_Time_Series_Toolbox
Financial_Toolbox
Fixed_Income_Toolbox
Fixed_Point_Designer
Fixed_Point_Toolbox
Fixed-Income_Toolbox
Fixed-Point_Designer
Fixed-Point_Toolbox
Fuzzy_Logic_Toolbox
GARCH_Toolbox
Gauges_Blockset
Genetic_Algorithm_and_Direct_Search_Toolbox
Global_Optimization_Toolbox
GPU_Coder
HDL_Coder
HDL_Verifier
IEC_Certification_Kit
Image_Acquisition_Toolbox
Image_Processing_Toolbox
Industrial_Communication_Toolbox
Instrument_Control_Toolbox
Lidar_Toolbox
Link_for_Code_Composer_Studio
Link_for_ModelSim
Link_for_TASKING
LTE_HDL_Toolbox
LTE_System_Toolbox
LTE_Toolbox
Mapping_Toolbox
MATLAB
MATLAB_Builder_EX
MATLAB_Builder_for_.NET
MATLAB_Builder_for_COM
MATLAB_Builder_for_Excel
MATLAB_Builder_for_Java
MATLAB_Builder_for_Java_Language
MATLAB_Builder_JA
MATLAB_Builder_NE
MATLAB_Coder
MATLAB_Compiler
MATLAB_Compiler_SDK
MATLAB_Distributed_Computing_Engine
MATLAB_Distributed_Computing_Server
MATLAB_Parallel_Server
MATLAB_Production_Server
MATLAB_Report_Generator
MATLAB_Web_App_Server
MATLAB_Web_Server
Mixed_Signal_Blockset
Mixed-Signal_Blockset
Model_Based_Calibration_Toolbox
Model_Predictive_Control_Toolbox
Model-Based_Calibration_Toolbox
Motor_Control_Blockset
Navigation_Toolbox
Neural_Network_Toolbox
OPC_Toolbox
Optimization_Toolbox
Parallel_Computing_Toolbox
Partial_Differential_Equation_Toolbox
Phased_Array_System_Toolbox
Polyspace_Bug_Finder
Polyspace_Bug_Finder_Server
Polyspace_Code_Prover
Polyspace_Code_Prover_Server
Powertrain_Blockset
Predictive_Maintenance_Toolbox
Radar_Toolbox
Real_Time_Windows_Target
Real_Time_Workshop
Real_Time_Workshop_Embedded_Coder
Real-Time_Windows_Target
Real-Time_Workshop
Real-Time_Workshop_Embedded_Coder
Reinforcement_Learning_Toolbox
Requirements_Toolbox
RF_Blockset
RF_PCB_Toolbox
RF_Toolbox
Risk_Management_Toolbox
Robotics_System_Toolbox
Robust_Control_Toolbox
ROS_Toolbox
Satellite_Communications_Toolbox
Sensor_Fusion_and_Tracking_Toolbox
SerDes_Toolbox
Signal_Integrity_Toolbox
Signal_Processing_Blockset
Signal_Processing_Toolbox
SimBiology
SimDriveline
SimElectronics
SimEvents
SimHydraulics
SimMechanics
SimPowerSystems
SimRF
Simscape
Simscape_Driveline
Simscape_Electrical
Simscape_Electronics
Simscape_Fluids
Simscape_Multibody
Simscape_Power_Systems
Simulink
Simulink_3D_Animation
Simulink_Accelerator
Simulink_Check
Simulink_Code_Inspector
Simulink_Coder
Simulink_Compiler
Simulink_Control_Design
Simulink_Coverage
Simulink_Design_Optimization
Simulink_Design_Verifier
Simulink_Desktop_Real_Time
Simulink_Desktop_Real-Time
Simulink_Fixed_Point
Simulink_HDL_Coder
Simulink_Parameter_Estimation
Simulink_PLC_Coder
Simulink_Real_Time
Simulink_Real-Time
Simulink_Report_Generator
Simulink_Requirements
Simulink_Response_Optimization
Simulink_Test
Simulink_Verification_and_Validation
SoC_Blockset
Spline_Toolbox
Spreadsheet_Link
Spreadsheet_Link_EX
Stateflow
Stateflow_Coder
Statistics_and_Machine_Learning_Toolbox
Statistics_Toolbox
Symbolic_Math_Toolbox
System_Composer
System_Identification_Toolbox
SystemTest
Target_for_Freescale_MPC5xx
Target_for_Infineon_C166
Target_for_TI_C2000
Target_for_TI_C6000
Target_Support_Package
Target_Support_Package_FM5
Target_Support_Package_IC1
Target_Support_Package_TC2
Target_Support_Package_TC6
Text_Analytics_Toolbox
Trading_Toolbox
UAV_Toolbox
Vehicle_Dynamics_Blockset
Vehicle_Network_Toolbox
Video_and_Image_Processing_Blockset
Virtual_Reality_Toolbox
Vision_HDL_Toolbox
Wavelet_Toolbox
Wireless_HDL_Toolbox
Wireless_Testbench
WLAN_System_Toolbox
WLAN_Toolbox
xPC_Target
xPC_Target_Embedded_Option
Florian Dignath
el 3 de Dic. de 2025
0 votos
If you want to find out which toolboxes are licensed to you there is an easy way:
>> ver -support
lists the corresponding license in the last column of the output.
After struggling with this for many years I just found that option of the ver command. My suggestion to Mathworks: Please set 'ver -support' as the default or include that option in the output of 'help ver'.
Categorías
Más información sobre Real-Time Model Preparation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!