Matlab code on Modification of an inbuilt function

조회 수: 9 (최근 30일)
Aleem Ayobami
Aleem Ayobami 2021년 7월 19일
답변: Walter Roberson 2021년 7월 19일
i am working on a departmental project, 'Modification of matlab inbuilt function'. i am currently ignorant on how to go about it.
An example of a modified or rewritten inbuilt function could help and go a long way.
Say, inv(A). how do we do some modifcation regards to the function. A well/detailed example of the modification of the function is fervently needed.
i am new to matlab but i really need all the help i can get in order to make this project. it also an avenue to be well/learned.
  댓글 수: 1
Stephen23
Stephen23 2021년 7월 19일
In general "Modification of matlab inbuilt function" is very unlikely to be a good approach: you can easily break many many things in your MATLAB installation without realizing it. I strongly recommend you avoid doing this.
A much better approach would be to create your own data class, and overload the numeric operators to suit:

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

답변 (2개)

Steven Lord
Steven Lord 2021년 7월 19일
We do not distribute the source code of the inv function. Therefore if you want to modify it you will need to start on our Careers page. Or if you want to request that MathWorks changes how inv is implemented to add additional functionality you could file an enhancement request with Technical Support using the Contact Support link on the Support section of our website. [That's also how you can report bugs in the software.]
There are two different types of functions that users commonly refer to as "built-in" functions. Some are built into the application and we do not distribute their source code. inv falls into this category. Others I refer to as "MATLAB scripts / functions / classes included in MATLAB". One example of this is the ode45 function, implemented as a MATLAB function file ode45.m.
which ode45
/MATLAB/toolbox/matlab/funfun/ode45.m
While you could modify the latter class of functions, I strongly discourage you from doing so unless you are extremely familiar with the subject matter and have made a backup of the unmodified function. Changing the answers those functions return can impact other functions that call those functions and those other functions can impact yet other functions, etc.

Walter Roberson
Walter Roberson 2021년 7월 19일

카테고리

Help CenterFile Exchange에서 Calendar에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by