I have sigmoid graph and I want to stop the time until 4th and continue from day 10th until day 30th. Can I make like this?
1 次查看(过去 30 天)
显示 更早的评论
M1(1)=0;
t(1)=0;
h=0.01;
dt=-5:h:30;
t=zeros(length(dt),1);
M1=zeros(length(dt),1);
for i= 1:length(dt)
t(i+1)=t(i)+h*i;
M11=M1(i)+1./(1+exp(-dt));
end
plot(dt,M11,'k','Linewidth',3);
xlabel('Time (day)','Fontsize',14,'FontWeight','bold');
ylabel('Concentration (g/mL)','Fontsize',12,'FontWeight','bold');
4 个评论
Mathieu NOE
2024-3-4
hello @cindyawati cindyawati
see this Fex submission
you get this nice looking result with only one extra line of code : (and no need for the for loop as already mentionned by @Torsten)
h=0.01;
dt=-5:h:30;
M11 = 1./(1+exp(-dt));
plot(dt,M11)
%Break The Axes
h = breakxaxis([15 25]);
采纳的回答
Chunru
2024-2-29
M1(1)=0;
t(1)=0;
h=0.01;
dt=-5:h:30;
t=zeros(length(dt),1);
M1=zeros(length(dt),1);
for i= 1:length(dt)
t(i+1)=t(i)+h*i;
M11=M1(i)+1./(1+exp(-dt));
end
ind = dt>=15 & dt<=25;
M11(ind) = nan;
plot(dt,M11,'k','Linewidth',3);
xlabel('Time (day)','Fontsize',14,'FontWeight','bold');
ylabel('Concentration (g/mL)','Fontsize',12,'FontWeight','bold');
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!