Effacer les filtres
Effacer les filtres

ho to apply upper boundary for cumulaitive percentage

1 vue (au cours des 30 derniers jours)
liyana nadirah
liyana nadirah le 31 Jan 2020
Commenté : Pravin Jagtap le 4 Fév 2020
l=input('l=')
g = zeros(1, length(0:100));% initialize g with 0's of length t
c = 1;% counter variable
for t=0:100
if t>2 && t<=80
g(c)=((3/(309*1.465))*((((12.6*(t-2))/l)*80.4)-(l/6)));
elseif t>80
g(c)=1-((80.4/309)*exp(((((-3*12.6)/(1.465*l))*(t-80)))));
else
g(c)=0;
end
c = c+1;% increment counter variable
end
format shortG
g
t=0:100;
gs = cumsum(g);
gs = gs / gs(end) * 100;
plot(t,gs,'r')
xlabel('Day')
ylabel('Cumulative percentage of nutrient release,%')
this is my coding and i have to apply the up boundary for cumulative percentage of g which is 73%. so can someone help me
  4 commentaires
Rik
Rik le 31 Jan 2020
You will have to be a little bit more verbose. When I run your code (setting L to 1), I don't see anything related to 73% showing up. I get a normal graph, so I don't see your issue.
Relatedly, you really shouldn't use a lower case L as a variable name. It is difficult to distinguish from the number 1.
Pravin Jagtap
Pravin Jagtap le 4 Fév 2020
Hello Liyana,
The statement 'i have to apply the up boundary for cumulative percentage of g which is 73%' is not clear. I found the attached output for 'l=2'. Does that mean you dont want values in g vector above 73? We need some more clarity on question.
figure1.png

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Discrete Data Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by