Array inputs in lsim function

7 Ansichten (letzte 30 Tage)
Prajwal Vinod
Prajwal Vinod am 23 Nov. 2020
Beantwortet: Star Strider am 23 Nov. 2020
I have a discrete time state space model with A,B,C,D matrices and 3 inputs. 2 inputs are constant but one input is an array which is 3501x1. How do I implement this in the code once I have defined all the variables and the system by using lsim ? Or am I not supposed to use lsim at all and do it in some different way ? I also have to compare the output values with another given set of values. How do I go about doing this ? Thank you. Any and all help is appreciated.

Akzeptierte Antwort

Star Strider
Star Strider am 23 Nov. 2020
Likely the easiest way is to create an (Nx3) matrix for ‘u’, with the constant inputs as constant vectors:
N = 3501;
u = [ones(N,1)*C1, ones(n,1)*C2, array_input];
with ‘C1’ and ‘C2’ the constant values. Be sure that ‘t’ is also (3501x1).

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by