MATLAB executes shadowed function (instead of my own version)
조회 수: 4 (최근 30일)
이전 댓글 표시
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
Stephen23
2020년 11월 13일
@Sinan Islam: you can have multiple functions of the same name:
- with private functions: https://www.mathworks.com/help/matlab/matlab_prog/private-functions.html
- with classes, import etc.: https://www.mathworks.com/help/matlab/ref/import.html
- changing the path (not recommended)
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!