setParameterDefault

Simple function to set the default value for an optional function argument if omitted or empty.

現在この提出コンテンツをフォロー中です。

%Example:
function y = f(x,t)
setParameterDefault('x',1);
setParameterDefault('t',3);
y = 3*x-2*t;

try:
f('', 1); -> x=1 -> y = 1
f(2); -> t=3 -> y = 0
f('', []); -> x=1, t=3 -> y = -3

引用

Tobias Kienzler (2026). setParameterDefault (https://jp.mathworks.com/matlabcentral/fileexchange/31285-setparameterdefault), MATLAB Central File Exchange. に取得済み.

カテゴリ

Help Center および MATLAB AnswersCharacters and Strings についてさらに検索

一般的な情報

MATLAB リリースの互換性

  • すべてのリリースと互換性あり

プラットフォームの互換性

  • Windows
  • macOS
  • Linux
バージョン 公開済み リリース ノート Action
1.1.0.0

description improved

1.0.0.0