How can I clear locked functions from memory?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
When I start MATLAB and type the following commands at the MATLAB command prompt:
clear functions
inmem
I obtain the following result:
ans =
Empty cell array: 0-by-1
Now if I simulate a model, for example "sf_car", and type the following at MATLAB command prompt:
sim('sf_car')
bdclose all
clear functions
inmem
I recieve the following result while I expect an empty array:
ans =
'simulink\private\slpmloadfunction'
'slsfnagctlr'
'slroot'
'signalselector'
'sigandscopemgr'
'modelrefsiglog'
I want to clear these functions from memory.
Respuesta aceptada
MathWorks Support Team
el 21 de En. de 2010
The functions remain in memory because they are locked. Use the MISLOCKED function to determine if a function is locked. The locked function can be unlocked using the MUNLOCK function.
For example, if the function FISLOCK is a locked function, type the following commands at MATLAB command prompt, to identify and unlock the function:
mislocked 'fislock' %Checks if fislock is locked
munlock 'fislock' % Do this if the reult for the previous command is 1 or true
clear all; clear functions; %Clears unlocked functions from memory
inmem
Now the function fislock will not appear in the result.
The attached file, clearmemory.m can be run to unlock and remove locked function from memory.
NOTE: These functions may be locked in memory for a reason. Unlocking and clearing can cause other issues. Before clearing a function, ensure that it indeed must cleared.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Scope Variables and Generate Names en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!