e418.m

来自「学习Matlab循环语句的好例子」· M 代码 · 共 25 行

M
25
字号
% Script file logx.m

%  Purpose:
%    To calculate the y(x)=log(1/(1-x))  the value of x must be <1
% else the value of x is illegal

% Record of revisions:
%    Date           Programmer             Description of change
%  =======       ===============        ==========================
%  06/06/08         ZMW                    Original code

% Define variables
% x     ----- input variable
% y     ----- output value
x=input('Please input the value of x:');
if x>=1
    disp('x is illegal!');
else
    while x<1
       y=log(1/(1-x))
       x=input('Please input the value of x:');
    end
end

⌨️ 快捷键说明

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