MATLAB: Norm inbuilt function code

inbuiltnorm

I am trying to find the code for the inbuilt function norm, but, by typing "open norm" I would only find a script describing it, not the code. I need to write the m file as funtion in order to add it in my folder with the other functions (for instance deg2rad which is another but its code is aveilable by typing "open deg2rad")

Best Answer

That's how all builtin functions work in Matlab, that's why they're "built in"; the working part of the function is compiled code built into the executable for the program. Core functionality is incorporated in that manner to improve performance; other routines are just supplied m-code no different than user-written as far as their implementation. There are also p-code and mex files...
Why do you think you need to include the function in some other location; there really is no reason to do that in general. Occasionally one will take a specific m-file and create a slightly modified version for a specific purpose, but it's highly recommended to make the user copy distinct and to not modify nor alias actual distributed functions.