필터 지우기
필터 지우기

Is it possible to rename a protected .p function?

조회 수: 1 (최근 30일)
cwshep
cwshep 2015년 6월 26일
편집: cwshep 2015년 6월 26일
Question in the title.
More information:
I am having compatibility issues with a protected (.p) third party function that is called by other third party functions. A workaround would be to create my own version of the function that handles the issues, then call the original function. Unfortunately, due to Matlab's function precedence, and the fact that the function indirectly calls itself, I haven't been able to find a way to do this, as outlined here . The only other way I can think to workaround this is by renaming the original function, but since it is protected I don't see an obvious way to do this.
  댓글 수: 2
dpb
dpb 2015년 6월 26일
Can you not write a "wrapper" function that does whatever then calls the 3rd party function? That would, in essence, be the same as renaming the existing one it would seem.
cwshep
cwshep 2015년 6월 26일
편집: cwshep 2015년 6월 26일
That's actually what I'm trying to do... the problem is that the original function is indirectly recursive (a function it calls then calls it again*). Even with a wrapper the only way to call the original function is to make it take precedence on the path (in the wrapper function), which means that when it is called recursively the original function is called, not the wrapper.
*This is important since if it was directly recursive I could actually use a private function in the original class to call the wrapper.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by