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

조회 수: 1 (최근 30일)
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
DGM
DGM 2021년 7월 30일
Well don't I look dumb. I'm always a few years behind the curve, aren't I?
Rik
Rik 2021년 7월 30일
A few years being 4 months in this case, so I think you're still fine ;)

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by