MATLAB executes shadowed function (instead of my own version)

Hey,
I want to implement a few loading features when opening a specific .MAT file my double clicking it.
Therefore I copied the uiimport() function from the matlab root and added some test output. But when calling the function with uiimport('C:\...file.mat'), MATLAB still uses the "old" shadowed function. The step-by-step debugging is also using the "old" file's line numbers but shows my edited version of the function... Pretty strange!
Is this expected behaviour? Thanks in advance.
"which -all uiimport" shows this:
C:\mypath\uiimport.m
C:\Program Files\MATLAB\R2016b\toolbox\matlab\codetools\uiimport.m % Shadowed

5 commentaires

Try
clear uiimport
in case there is a cached version.
If that does not work,
rehash toolboxcache
Julian Tomsik
Julian Tomsik le 22 Nov 2019
Modifié(e) : Julian Tomsik le 22 Nov 2019
I've just tried that. It still won't execute the correct function. Thanks anyway.
edit: nvm, restarting an then clearing the cache seems to have helped
What if someone which to have several functions with the same name?
Is there any way to qualify functions in MATLAB? Perhaps, qualify a function by its file path?
@Sinan Islam: you can have multiple functions of the same name:
This discussion is probably relevant to this topic.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Environment and Settings dans Centre d'aide et File Exchange

Produits

Version

R2016b

Commenté :

Rik
le 13 Nov 2020

Community Treasure Hunt

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

Start Hunting!

Translated by