Source Code of the MuPAD Library Functions

You can display the source code of the MuPAD® built-in library functions. If you work in the MuPAD Notebook app, enter expose(name), where name is the library function name. The MuPAD Notebook app displays the code as plain text with the original line breaks and indentations.

You can also display the code of a MuPAD library function in the MATLAB® Command Window. To do this, use the evalin or feval function to call the MuPAD expose function:

sprintf(char(feval(symengine, 'expose', 'numlib::tau')))
ans =
proc(a)
  name numlib::tau;
begin
  if args(0) <> 1 then
    error(message("symbolic:numlib:IncorrectNumberOfArguments"))
  else 
    if (~testtype(a, Type::Numeric)) then
      return(procname(args()))
    else 
      if domtype(a) <> DOM_INT then
        error(message("symbolic:numlib:ArgumentInteger"))
      end_if
    end_if
  end_if; 
  numlib::numdivisors(a)
end_proc

MuPAD also includes kernel functions written in C++. You cannot access the source code of these functions.

Was this topic helpful?