inp.m

버전 1.1.0.0 (2.31 KB) 작성자: Miroslav Balda
The function inp.m serves for keyboard input supported by default value
다운로드 수: 5.6K
업데이트 날짜: 2009/1/12

라이선스 보기

The function implements keyboard input supported by a default value. A user may either accept the default value or enter a new one. Controlled input of data from the keyboard is advantageous for debugging, making protocols via function diary, parametric studies when changing parameters depending on a result of the current iteration, branching run of a program under user wishes, etc, all without debugging.

Forms of a call:
~~~~~~~~~~~~~~~~
inp % display help
data = inp; % similar to input('input')
data = inp(prompt); % similar to input(prompt)
data = inp(prompt,deflt);
data = inp(prompt,deflt,form);
data = inp(prompt,deflt,form,nsp);
% prompt = string of characters
% input with a default value of input data
% form = format of the screen output; default '%9.4f'; format is persistent until new value is given
% nsp = number of leading spaces before prompt on screen; nsp = 10 is persistent until a new value is given
% data = either deflt value if accepted by ENTER, or a new input value

Examples:
~~~~~~~~~
p = inp('pressure [MPa]',7.5); % if no new value is given, p=7.5
if strcmp(inp('Continue','yes'),'yes') % for user's on-line decission
% True branch
else
% False branch
end
A = eval(inp('A','[B,x]')); % A = [B,x] if no new input
cx = inp('cxconst',1+i*pi); % gives cx = 1+3.14159i, if accepted

인용 양식

Miroslav Balda (2024). inp.m (https://www.mathworks.com/matlabcentral/fileexchange/9033-inp-m), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2006b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Desktop에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.1.0.0

Implemented better displaying of comples numbers. Improved description.

1.0.0.0

Improving description