Clear Filters
Clear Filters

ho to apply upper boundary for cumulaitive percentage

1 view (last 30 days)
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 Comments
Rik
Rik on 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 on 4 Feb 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

Sign in to comment.

Answers (0)

Categories

Find more on Discrete Data Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!