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.
Best Answer