Why does not Matlab language support function/operator chaining?

7 visualizaciones (últimos 30 días)
alex_u1
alex_u1 el 31 de Mzo. de 2022
Editada: Jan el 31 de Mzo. de 2022
E.g.:
setdiff(1:3, randi(3))(randi(2))
One must factor out the resulting list from setdiff into a separate variable first:
t = setdiff(1:3, randi(3));
t(randi(2))
This is so medieval even by 1980s standards...

Respuestas (1)

Jan
Jan el 31 de Mzo. de 2022
Editada: Jan el 31 de Mzo. de 2022
Matlab does not support this, because it has not been implemented yet.
Sorry. The answer is trivial.
I'm using Matlab to solve problems. It did not prevent me to find a solution, that I have to store the output in a variable before I can apply an index.

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by