"Input parser" vs. new "arguments" definition
조회 수: 21 (최근 30일)
R2019b introduced the new "arguments" section for function argument checking and parsing.
I hahe written some functions using the "old" input parser class. Are there any advantages to switch to the new syntax?
Is it worth to update my functions to the new syntax? (sure, I know, "never change a running system")
埃博拉酱 2023년 4월 7일
편집: 埃博拉酱 님. 2023년 4월 7일
The biggest advantage of the arguments block is readability, but it is far less flexible than varargin. People who are not familiar with your code can quickly understand your parameter requirements through the arguments block.
Another potential advantage may be ease of compiler optimization. Overly flexible varargin is difficult to optimize for performance.