Issue with InputVisibility for lsimplot
12 次查看(过去 30 天)
显示 更早的评论
I am trying to generate a plot of a response of a StateSpace System (1 Input, 5 Outputs, with Outputs 2,3 and 4 of interest) to an predefined input. When using the lsimplot() function, it automatically displays the input in every subplots what makes it quiet hard to see the acutal response at its magnitude is significantly smaller.
To avoid removing it each time manually in the figure, i tried to manipulate the InputVisible-Option.
figure(1)
plot1 = lsimplot(dyn_sys(2:4),u_sim,t_sim);
plot1.InputVisible = {'off'}
But in this case the response is not plotted at all (emtpy figure, only showing the axis labels). Any other syntax like
plot1.InputVisible = 'off'
or
plot1.InputVisible = false
resulted in an Error when running the file.
"Cell array of character vectors may only contain character vectors and numeric matrices.
Error in XXX
plot1.InputVisible = 'off' "
Note: I recognised that the by default the "InputVisible"-Parameter is not "on" or "true" as I expected but empty.
Has anybody encountered the same problem and knows how to resolve it?
0 个评论
回答(1 个)
Star Strider
about 1 hour 前
编辑:Star Strider
23 minutes 前
It would probably help to have the omitted parts of your code.
What you want to do works here (R2025b).
A work-around would be to recover the data you want, and plot it separately. In order to get that information, it will be necessary to dive deeply into the lsimplot properties.
Using an example from the lsimplot documentation, this shows one approach --
A = [-2-2i -2;1 0];
B = [2;0];
C = [0 0.5+2.5i];
D = 0;
sys = ss(A,B,C,D);
figure
[u,t] = gensig("square",4,12);
lp = lsimplot(sys,u,t);
lp.InputVisible='off';
figure
[u,t] = gensig("square",4,12);
lp = lsimplot(sys,u,t);
% get(lp)
Kids = lp.Children;
% get(Kids)
GKids = Kids.Children;
% get(GKids)
GGKids = GKids.Children;
% get(GGKids)
GGGKids = GGKids.Children
Line1 = GGGKids(1)
Line3 = GGGKids(4)
figure
plot(Line1.XData, Line1.YData, DisplayName="Simulation Response")
hold on
plot(Line3.XData, Line3.YData, DisplayName="Time-Magnitude Response")
hold off
legend(Location='best')
I commented-out most of the get calls. Uncomment them to see what they reveal.
.
EDIT -- (17 Dec 2025 at 14:38)
Clarified explanation.
.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Classical Control Design 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


