How can i remove (or hide) the time units ("(seconds)") from the stepplot graphic in the x-axis?
50 次查看(过去 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)');
0 个评论
采纳的回答
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 Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!