%% Discrete-Time Sparse Second-Order Model
% For this example, consider the sparse matrices of the discrete system in the file discreteSOSparse.mat.
% Load the sparse matrices from discreteSOSparse.mat.

load('discreteSOSparse.mat','M','C','K','B','F','G','D','ts');

% Create the discrete-time mechss model object by specifying the sample time ts.

sys = mechss(M,C,K,B,F,G,D,ts)

% The output sys is a discrete-time mechss model object with 28408 degrees of freedom, 1 input, and 1 output.
% You can use the spy command to visualize the sparsity pattern of the mechss model object. You can right-click on the plot to select matrices to be displayed.

spy(sys)

% Copyright 2020 The MathWorks, Inc.