ureal function in the Robust Control Toolbox
11 views (last 30 days)
Show older comments
Hi,
TLDR: How to get MATLAB to plot the responses for all the uncertain models generated (using the ureal function) for a sinusoidal input?
I am trying to model an uncertain spring mass damper system. The uncertainitites have been introudced in the following way:
um = ureal('m',3,'Percentage',10);
ub = ureal('c',1,'Percentage',10);
uk = ureal('k',2,'Percentage',10);
H is the Plant model, and I'm trying to determine its output response to different inputs in the following way:
impulse(H);
step(H);
And I get multiple graphs (20 different plots) for the different values of m, b, k for the step response as shown:

Same is the case for the impulse response. However, when I try to simulate the response to a sinusoidal input, only one plot is shown. How do I make MATLAB plot the responses of all uncertain systems that MATLAB has generated in a single graph like its doing automatically for the step response? I'm using the following code to plot the sinusoidal response:
t1 = linspace(0, 50, 1000);% Time Vector
u1 = 1*sin(10*t1); % Forcing Function
y1 = lsim(H, u1, t1); % Calculate System Response
plot(t1, y1);
title('response to 1*sin(10*t1) v t');
xlabel('t');
ylabel('sinusoidal response');
Thank you!
0 Comments
Answers (0)
See Also
Categories
Find more on Uncertain Models in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!