Calling TOGGLETOOLBOX() multiple times for different % TOGGLETOOLBOX() attempts to keep the order of all paths as close to MATLAB's Since the order of the path is important for name resolution, % Disabling a toolbox is done by removing the relevant directories from the % states contained in, where is a structure previously returned by % TOGGLETOOLBOX(S0) will reset the on/off states of all toolboxes to the % change will only last for the remainder of the current session. For equal to 'temporary' (the default), the % 'permanent' will attempt to make the change persist between different % S = TOGGLETOOLBOX(., permanency) for string equal to % toolbox name(s) as fields, with the on/off state represented as true/false. The return argument is a structure containing the % be equal to the toolbox' installation directory name (the same as used by % S = TOGGLETOOLBOX(toolbox, state) queries or sets the on/off state of the % applicable to the current MATLAB installation. % M = TOGGLETOOLBOX('names') returns the full names / directory names map % S = TOGGLETOOLBOX('all') queries the on/off states of all installed But experience shows that MATLAB may do very different things from version to version, so if you find a problem, get a strange error, etc., please tell me, so I can make repairs.įor now, here's version 1.0: % TOGGLETOOLBOX Utility to switch MATLAB toolboxes on or off. I've tested this only on R2010a, where it passes all my unit tests. (actually, I'll leave it in, because that would turn the answer into a link-only reply, as rightfully remarked by Andy Clifton). I'll post this on the FEX, and after it's approved, I'll place a link to it here.ĮDIT 1 they approved my submission, which can be found here or directly from my GitHub. I will submit a ticket to MathWorks and update the question if I hear back unless someone has another workaround. with the paths added back, n = gpuDeviceCounts still throws the first error). The first is unexpected and could happen for any number of reasons such as a corrupt install or a stupid typo on my part (e.g. The second one is expected and if I could easily and deliberately throw that error, I could see what exception to test for in a try/catch block and behave appropriately. These products offer 'gpuDeviceCount':ĭifferent errors, different exceptions thrown. GpuDeviceCount is not included in your installed products. Undefined function or variable 'gpuDeviceCount'.īut when I asked a friend, who does not have the parallel toolbox installed, to type in the same command, he got the following: > gpuDeviceCount For instance, after I removed the directories, I get the following behavior: > n = gpuDeviceCount It also throws different errors, and so this method cannot be used to adequately test the behavior in my program. Once that was done, typing in ver still shows that the Parallel Toolbox is installed. First of all, the toolbox is not in a single directory, it is in several (I had to rmpath 11 directories for Parallel Toolbox and I don't really know if I got them all). Simply removing the path does not disable the toolbox. Is there any way, short of repeatedly uninstalling and then reinstalling the toolbox, or else buying a second license and installing on a second computer (or the same computer with a different username), to temporarily make MATLAB think that it isn't available?įrom the comments to the question, it appears the answer to my question is "no". To generalize the situation, I would like to be able to test the behavior of an application when a toolbox dependency is not met so I can either provide a meaningful message to the user for why they can't use my application or else provide a workaround. The problem is that since I have the toolbox installed, I never get an error when I try to use a parallel toolbox function, so I can't test the failure points. I am writing an application that will be sent out to customers who may not have that toolbox installed and I would like to write my application so that it fails gracefully (i.e. I have a standalone license for MATLAB R2016b with the Parallel Toolbox.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |