ho to apply upper boundary for cumulaitive percentage

1 visualización (últimos 30 días)
liyana nadirah
liyana nadirah el 31 de En. de 2020
Comentada: Pravin Jagtap el 4 de Feb. de 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 comentarios
Rik
Rik el 31 de En. de 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 el 4 de Feb. de 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

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Discrete Data Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by