2018-06-16 22:57:54 +02:00
|
|
|
function [] = initializeSample(opts_param)
|
|
|
|
%% Default values for opts
|
2018-10-24 15:08:23 +02:00
|
|
|
sample = struct('radius', 100, ...
|
|
|
|
'height', 300, ...
|
|
|
|
'mass', 50, ...
|
|
|
|
'offset', 0, ...
|
2018-07-03 15:28:29 +02:00
|
|
|
'color', [0.45, 0.45, 0.45] ...
|
2018-06-16 22:57:54 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
%% Populate opts with input parameters
|
|
|
|
if exist('opts_param','var')
|
|
|
|
for opt = fieldnames(opts_param)'
|
|
|
|
sample.(opt{1}) = opts_param.(opt{1});
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
%% Save if no output argument
|
2018-10-11 10:25:57 +02:00
|
|
|
save('./mat/stages.mat', 'sample', '-append');
|
2018-06-16 22:57:54 +02:00
|
|
|
end
|