When simulating the response to a specific input signal, the input data U must be a matrix of numeric values with at least two rows (samples) and without any NaN or Inf.

 Accepted Answer

'u' must have as many rows as the number of elements in 't'. It seems that you want to apply step inputs. Try something like this
t = 0:0.4:10;
u = repmat([2, 0.2], numel(t), 1);
lsim(SS, u, t);

3 Comments

Thank you so much ! it worked but i don't get what happened i am assuming i gave two rows of input as my model needs?
You need to specify it as two columns. The number of rows should be the same as the number of elements in t. u is like this
u = [
2 0.2;
2 0.2;
..
..
2 0.2]; % rows same as numel(t)
Yeah i searched for these functions on mathworks. It goes like you said ,thanks

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!