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

2 views (last 30 days)
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{:});

Sign in to comment.

Answers (0)




Community Treasure Hunt

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

Start Hunting!