stepf.m
来自「Dispersion de Rutherford en Matlab」· M 代码 · 共 15 行
M
15 行
%stepf.m
function step=stepf(x,s,ss)
% This is a step function stepf(x,s,ss)
% x is the input array, s the value where the step occurs
% if ss=1 the step occurs at 's' from 1 to 0 for all x
% if ss=2 the step occurs at 's' from 0 to 1 for all x
% if ss is neither 1 nor 2 the function returns the value of zero
if ss==1
step=1./(1+exp(100*(x-s)));
elseif ss==2
step=1-1./(1+exp(100*(x-s)));
else
step=0.0;
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?