What is the best way to organize parameters in a flexible way?
Show older comments
Interpretation of some parameters depend on other parameters, and I want to store a meaningful name if possible. As an example:
type_of_function = 'linear' or 'sinusoid' if linear: a and b should be the parameters if sinusoid: amplitude, phase, frequency should be the parameters.
So how to organize my parameters? In a structure? Or cell array? And how?
Accepted Answer
More Answers (1)
I would think in a class so that you write a class functionType which can hold two classes either linear or sinusoid and than define a class for both the linear and the sinusoid which defines which parameters these classes can hold
organizing as a class has an additional advantage that you can also define methods that perform calculations with your parameters
Categories
Find more on Structures in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!