主题:记得以前有一个可以看MATLAB内部源程序的命令...请教!
michaelily
[专家分:0] 发布于 2006-11-03 20:41:00
现在搞忘了...
请教大侠们告知!!
比如看sin 或者cos函数的M文件源程序!![em1]
回复列表 (共7个回复)
沙发
kook110 [专家分:0] 发布于 2006-11-04 17:44:00
type 命令~
板凳
michaelily [专家分:0] 发布于 2006-11-05 22:32:00
>> type sin
sin is a built-in function.
>> type plot
plot is a built-in function.
>>
好像还是不行也
...
再求助!!!
3 楼
abingchem [专家分:230] 发布于 2006-11-07 08:35:00
有些内部函数是比较机密的,当然不能都开放了
4 楼
gslyd [专家分:1300] 发布于 2006-11-08 08:30:00
象sin,cos等的 m文件在matlab\toolbox\eml\lib\matlab
文件夹中(R2006a版),其它源程序在相近的文件夹中。
如:
function y = sin(x)
% Embedded MATLAB Library function.
% Copyright 2002-2005 The MathWorks, Inc.
% $Revision: 1.1.6.7 $ $Date: 2005/05/31 16:29:00 $
eml_assert(nargin > 0, 'Not enough input arguments.');
eml_assert(isfloat(x), ['Function ''sin'' is not defined for values of class ''' class(x) '''.']);
if isreal(x)
eml_must_inline;
y = eml_sin(x);
else
% Adapted from utComplexScalarSin in src\util\libm\cmath1.cpp
y = complex(zeros(size(x),class(x)));
for k = 1:numel(y)
xr = real(x(k));
xi = imag(x(k));
if xi == 0
y(k) = complex( eml_sin(xr) , 0 );
else
y(k) = complex( eml_sin(xr)*eml_cosh(xi) , eml_cos(xr)*eml_sinh(xi) );
end
end
end
5 楼
guoguoyingying [专家分:0] 发布于 2007-06-26 21:53:00
[color=FF0000]我现在需要diff的原文件,怎么找也找不到,请教高手帮助[/color]
6 楼
Guassfans [专家分:4090] 发布于 2007-06-26 22:17:00
matlab\toolbox下搜索diff.m
7 楼
guoguoyingying [专家分:0] 发布于 2007-06-26 23:29:00
收了,都不是,你能收到吗,贴出来给我好吗
我来回复