How can i remove (or hide) the time units ("(seconds)") from the stepplot graphic in the x-axis?

조회 수: 51 (최근 30일)
numM=[1.123];
denM=[1 0.1912];
M=tf(numM,denM, 'Outputdelay',0.02);
hfig=figure;
for f=[0.3 0.5 0.7 0.1]
sim("Evaporador_18_03_2023.slx");
plot(t,xP_d,'--','LineWidth',2);
ax = gca;
colororder(["#E68000";"#8040E6";"#000000";"#A2142F"])
hold all
end
for x=[0.3 0.5 0.7 0.1]
opt = stepDataOptions;
opt.StepAmplitude =x;
m=stepplot(M,opt,40);
%setoptions(h,'TimeUnits','hours','Grid','on');
hold all
end
hold off
grid;
title('Comparação....');
xlabel('Tempo (horas)') %i want this label without the "(seconds)" in the end
ylabel('% weight');
legend('xF vs xP(0.3)','xF vs xP(0.5)','xF vs xP(0.7)','xF vs xP(0.1)','M(0.3)','M(0.5)','M(0.7)','M(0.1)');

채택된 답변

Paul
Paul 2023년 3월 19일
If you're willing to accept 'hours' in the label instead of 'horas' then set the TimeUnit property of M
numM=[1.123];
denM=[1 0.1912];
M=tf(numM,denM, 'Outputdelay',0.02,'TimeUnit','hours');
opt = stepDataOptions;
opt.StepAmplitude =1;
m=stepplot(M,40,opt); % had to reverse the arguments
xlabel('Tempo')
If that's not acceptable, it's probably easier to use step() and create your own plot
[y,t] = step(M,40);
plot(t,y);
xlabel('Tempo (horas)')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Stability Analysis에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by