Issue with InputVisibility for lsimplot
조회 수: 22 (최근 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
답변 (2개)
Star Strider
2025년 12월 17일
편집: Star Strider
2025년 12월 17일
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.
.
Andrew Ouellette
2025년 12월 23일 23:41
Hi @Hannes
The documented chart API for LSimPlot was introduced in R2024b. You will need to upgrade to that release or later to make use of the documented API.
t = 0:0.1:10;
u = sin(t);
lp = lsimplot(rss(3),u,t);
lp.InputVisible = false;
In releases before R2024b, the lsimplot function created a resppack.simplot object. As you've discovered, this object has several undocumented properties. The InputVisible property actually refers to the visibility of axes columns in the plot rather than the input line. To hide the input lines, you can set h.Input.Visible to 'off', where h is the resppack handle outputted by lsimplot.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



