Syntax:
DEFAULTS('Variable',Value)
Problem:
Usually in a function call:
out = function(Var1, Var2)
if (~exist('Var1','var')
Var1 = 1234;
end
if (~exist('Var2','var')
Var2 = 3456;
end
This gets tedious after a while.
Solution using DEFAULTS
out = function(Var1, Var2)
defaults('Var1',1234,'Var2',3456);
인용 양식
jl (2025). defaults.m (https://kr.mathworks.com/matlabcentral/fileexchange/47394-defaults-m), MATLAB Central File Exchange. 검색 날짜: .
MATLAB 릴리스 호환 정보
개발 환경:
R2011a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux카테고리
Help Center 및 MATLAB Answers에서 Argument Definitions에 대해 자세히 알아보기
태그
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!| 버전 | 게시됨 | 릴리스 정보 | |
|---|---|---|---|
| 1.0.0.0 |
