validate function inputs independent of position and name
이전 댓글 표시
Dear All,
I have the function f(a b c d), with a b c d inputs all structure arrays, a and b required, c and d optional. I want to validate inputs based on that a b c d are all structures (this may be redundant, see next), and/or more specifically, based on the name of some specific fields for each of the a b c d inputs, say a.fielda, b.fieldb, c.fieldc, and d.fieldd, but not the position or name of the arrays themselves (eg a b c d). Additionally, since my code uses C as intermediate, then output variable for input c, I want to make sure that if the name of c input is C, the validation will generate an error message, as I do not want c to be modified (the principle of input argument preservation). Please advise, I got stuck with using inputparser and validateattributes, I would appreciate some hands on example using info herein. Thank you,
Octavio.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Argument Definitions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!