필터 지우기
필터 지우기

How to acces the value of a Optional-Positional argument (~ argument) ?

조회 수: 2 (최근 30일)
D D
D D 2022년 3월 9일
편집: Matt J 2022년 3월 9일
I want a function like this:
function foo(a, b, ~)
foo2(a, b, ~) % two ~ are same
end
However it's not allowed. So how to access the value of ~, or find another way to pass it to foo2?

채택된 답변

Matt J
Matt J 2022년 3월 9일
편집: Matt J 2022년 3월 9일
The ~ doesn't mean the input is optional. It means the function doesn't care what it is. Since your function does care, use a named argument.
function foo(a, b, c)
foo2(a, b, c)
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Classical Control Design에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by