It's still not really clear, but what I think you want is for your function to infer or deduce which type of problem you're trying to solve (Rigid_body1_Rigid_body2, Rigid_body_oil, Rigid_body_Air, Oil_Air, etc.) without the user of your function having to specify that information explicitly. The data parameters that your user enters would somehow inform your function that you have two rigid bodies, a rigid body in an oil bath, etc.
That strikes me as potentially very dangerous. If you later on add a new type of problem that your function should handle it could be indistinguishable from an existing type of problem, breaking existing users of your function. Making your users enter the information about the type of problem to solve, while requiring your users to do a bit more work when solving a new problem, would let them (and you) be certain your function is solving the correct problem. There may be ways to make this safer (passing information around in struct arrays or objects that capture some information about what they represent without the user having to explicitly maintain that data or remember to pass it into the function) but that may be a bit more advanced a maneuver than you might want.
If that's not what you want, then I'm afraid you're going to need to explain a bit more. Start at a high level. Please answer these questions with short (ideally no more than one to three sentence) answers, no code.
- What problem are you trying to solve or what are you trying to compute? If possible, ELI5.
When I say ELI5 that doesn't actually mean explain it like we're five years old, but as the rules for the subreddit of that name states "Unless OP states otherwise, assume no knowledge beyond a typical secondary education program. Avoid unexplained technical terms. Don't condescend; "like I'm five" is a figure of speech meaning "keep it clear and simple.""
For MATLAB Answers you can assume a bit more knowledge than a secondary education, but don't assume we have as much knowledge of your application or your application area as you do.
- What do the potential inputs to and the variables (specifically A, B, and D) used in the Conductivity function represent? Remember, no code -- explain in words.
- What's the pain that you're trying to avoid by allowing your user to call your Conductivity function without the Contacts input argument? How would this benefit users of your function?