Skip to Main Content Skip to Search
Product Documentation

data2state(idnlarx) - Map past input/output data to current states of nonlinear ARX model

Syntax

X = data2state(MODEL,IOSTRUCT)
X = data2state(MODEL,DATA)

Description

X = data2state(MODEL,IOSTRUCT) maps the input and output samples in IOSTRUCT to the current states of MODEL, X. For a definition of the states of idnlarx models, see Definition of idnlarx States. The data in IOSTRUCT is interpreted as past samples of data, so that the returned state values must be interpreted as values at the time immediately after the time corresponding to the last (most recent) sample in the data.

X = data2state(MODEL,DATA) maps the input and output samples from DATA to the current states, X, of the model.

Input Arguments

Output Arguments

X is the state vector of MODEL corresponding to the time after the most recent sample in the input data (IOSTRUCT or DATA).

Examples

In this example you determine the current state of an idnlarx model.

  1. Load your data and create a data object.

    load motorizedcamera;  
    z = iddata(y,u,0.02,'Name','Motorized Camera', ...
                           'TimeUnit','s');
    
    
  2. Estimate an idnlarx model from the data. The model has 6 inputs and 2 outputs.

    mw1 = nlarx(z,[ones(2,2),ones(2,6),ones(2,6)],wavenet);
  3. Compute the maximum delays across all output variables in mw1.

    MaxDelays =  getDelayInfo(mw1);
  4. Represent the past input and output samples:

    IOData = struct('Input', ...
                     rand(max(MaxDelays(3+1:end)),6),...
                    'Output', ...
                     rand(max(MaxDelays(1:3)),2));
  5. Compute the current states of mw1 based on the past data in IOSTRUCT.

    X = data2state(mw1,IOData)
    

    The previous command computes the state vector.

See Also

findop(idnlarx) | findstates(idnlarx) | getDelayInfo

  


Free Control Systems Interactive Kit

Learn more about resources for designing, testing, and implementing control systems.

Get free kit

Trials Available

Try the latest control systems products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS