tanh.m

来自「计算动力学系统的分岔图」· M 代码 · 共 19 行

M
19
字号
function x = tanh(x)
% Tanhx for adtayl objects.

if ~isreal(x.tc)
  error('X for adtayl objects must not have imaginary part')
end
 
[m,n,p] = size(x.tc);
for i=1:m*n
    
    x1.tc= reshape(x.tc(i,:),[1, 1,p]); 
    x1=class(struct('tc',x1.tc),'adtayl');
    y= (exp(x1)-exp(-x1))/(exp(x1)+exp(-x1));
    
    xx1.tc(i,:)=y.tc;
   
 end
x.tc = reshape(xx1.tc, m,n,p);
x.tc =real(x.tc);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?