Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
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 comentarios
DGM
DGM el 30 de Jul. de 2021
Well don't I look dumb. I'm always a few years behind the curve, aren't I?
Rik
Rik el 30 de Jul. de 2021
A few years being 4 months in this case, so I think you're still fine ;)

Iniciar sesión para comentar.

Respuestas (0)

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by