nass-simscape/src/initializeSample.m

23 lines
709 B
Mathematica
Raw Normal View History

function [sample] = initializeSample(sample)
arguments
sample.radius (1,1) double {mustBeNumeric, mustBePositive} = 100
sample.height (1,1) double {mustBeNumeric, mustBePositive} = 300
sample.mass (1,1) double {mustBeNumeric, mustBePositive} = 50
sample.offset (1,1) double {mustBeNumeric} = 0
sample.color (1,3) double {mustBeNumeric} = [0.45, 0.45, 0.45]
2018-06-16 22:57:54 +02:00
end
2018-10-25 11:00:30 +02:00
%%
sample.k.x = 1e8;
2019-11-22 10:36:26 +01:00
sample.c.x = 0.1*sqrt(sample.k.x*sample.mass);
2018-06-16 22:57:54 +02:00
2018-10-25 11:00:30 +02:00
sample.k.y = 1e8;
2019-11-22 10:36:26 +01:00
sample.c.y = 0.1*sqrt(sample.k.y*sample.mass);
2018-10-25 11:00:30 +02:00
sample.k.z = 1e8;
2019-11-22 10:36:26 +01:00
sample.c.z = 0.1*sqrt(sample.k.z*sample.mass);
2018-10-25 11:00:30 +02:00
%% Save
save('./mat/stages.mat', 'sample', '-append');
2018-06-16 22:57:54 +02:00
end