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 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
cindyawati cindyawati
il 26 Feb 2024
Commentato: Mathieu NOE
il 4 Mar 2024
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 Commenti
Mathieu NOE
il 4 Mar 2024
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]);
Risposta accettata
Chunru
il 29 Feb 2024
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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!