function [ground] = initializeGround(args) arguments args.type char {mustBeMember(args.type,{'none', 'rigid'})} = 'rigid' args.rot_point (3,1) double {mustBeNumeric} = zeros(3,1) % Rotation point for the ground motion [m] end ground = struct(); switch args.type case 'none' ground.type = 0; case 'rigid' ground.type = 1; end ground.shape = [2, 2, 0.5]; % [m] ground.density = 2800; % [kg/m3] ground.rot_point = args.rot_point; if exist('./mat', 'dir') if exist('./mat/nass_model_stages.mat', 'file') save('mat/nass_model_stages.mat', 'ground', '-append'); else save('mat/nass_model_stages.mat', 'ground'); end elseif exist('./matlab', 'dir') if exist('./matlab/mat/nass_model_stages.mat', 'file') save('matlab/mat/nass_model_stages.mat', 'ground', '-append'); else save('matlab/mat/nass_model_stages.mat', 'ground'); end end end