Why does not Matlab language support function/operator chaining?

조회 수: 6 (최근 30일)
alex_u1
alex_u1 2022년 3월 31일
편집: Jan 2022년 3월 31일
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...

답변 (1개)

Jan
Jan 2022년 3월 31일
편집: Jan 2022년 3월 31일
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.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by