why do i get 'support for 'nargin' in a script has been removed?
12 ビュー (過去 30 日間)
古いコメントを表示
narginchk(1,3)
nargoutchk(0,1)
%%
% Set default values for embedding parameters.
t = 1;
m = 1;
%%
% Set input arguments
if nargin > 2
t = varargin{3};
end
if nargin > 1
m = varargin{2};
end
0 件のコメント
回答 (2 件)
Steven Lord
2023 年 3 月 8 日
Script files aren't allowed to have input or output arguments. Therefore it doesn't make sense to ask how many inputs or outputs the script file has. In release R2016b the nargin, nargout, and inputname functions started throwing errors when called from within a script.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Argument Definitions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!