data2state(idnlarx) - Map past input/output data to current states of idnlarx 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

Input

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 the idnlarx model from the data. The model has 6 inputs and 3 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); % delays arranged channelwise
    
  4. Determine the maximum delays across all channels in mw1.

    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(idnlarx) 

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS