Main Content

full

Convert sparse models to dense storage

    Description

    example

    fsys = full(sys) converts the sparss and mechss model sys to dense state-space representation ss. For mechss models, the conversion to dense representation is equivalent to full(sparss(sys)). For other model types, full leaves sys unchanged.

    Use the full command to convert small scale sparse models to dense storage to perform operations like pole/zero extraction, model order reduction, and controller design and tuning. Converting to dense storage is not recommended for large scale sparse models as it may saturate available memory and cause severe performance degradation.

    Examples

    collapse all

    For this example, consider sparseSOFull.mat that contains a sparse second-order model with 50 nodes.

    Load the sparse second-order model and convert it to dense representation using full.

    load('sparseSOFull.mat','sys');
    fsys = full(sys);
    size(fsys)
    State-space model with 1 outputs, 1 inputs, and 100 states.
    

    Since, sys is a mechss model, the conversion to dense storage is equivalent to fsys = full(sparss(sys)). The resultant model fsys is a full storage ss model object with 100 states since the mass matrix is full rank.

    Compare the storage size of the two representations.

    whos
      Name      Size             Bytes  Class     Attributes
    
      fsys      1x1             162930  ss                  
      sys       1x1               6576  mechss              
    

    Converting to dense storage is not recommended for large scale sparse models as it may saturate available memory and cause severe performance degradation.

    Input Arguments

    collapse all

    Sparse state-space model, specified as a sparss or mechss model object. For other model types, full leaves sys unchanged.

    Output Arguments

    collapse all

    Dense state-space model, returned as an ss model object. For more information on dense state-space model representation, see ss.

    Introduced in R2020b