Is it possible to enhance the new syntax "Name=Value Syntax" introduced in version R2021a?

2 views (last 30 days)
cui
cui on 30 Jul 2021
Commented: Rik on 30 Jul 2021
Specifically, further support for both positional and optional arguments, so that the readability of the program is significantly enhanced, rather than not seeing the obvious meaning of the arguments! For example, the following program fills an array, and I still get an error when I call it this way
能否对R2021a版本引入的“Name=Value Syntax”新语法进行功能增强?
具体内容是同时增强位置参数和可选参数的进一步支持,以便明显增强程序可读性,而不是看不出明显的参数含义!比如下面程序对一个数组进行填充,我这样调用仍然会出错
A = [ 1 2 3 4 ]
A = 1×4
1 2 3 4
B = padarray(A,3,9,'pre') % official document example, It is not easy to see the meaning of the numbers 3 and 9
B = 4×4
9 9 9 9 9 9 9 9 9 9 9 9 1 2 3 4
It is not easy to see the meaning of the numbers 3 and 9, and I need to consult further documentation to confirm the meaning of the numbers, I would like to call it in the following way, but the latest version of R2021 does not support such enhanced syntax, I hope that future versions will be improved!
B = padarray(A,padsize=3,padval=9,direction='pre') % Desired enhancements,but there is an error!
Error using padarray>ParseInputs (line 88)
Too many input arguments.

Error in padarray (line 75)
[a, method, padSize, padVal, direction, catConverter] = ParseInputs(args{:});
  4 Comments

Sign in to comment.

Answers (0)

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!