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

45 views (last 30 days)
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)');

Accepted Answer

Paul
Paul on 19 Mar 2023
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)')

More Answers (0)

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!