필터 지우기
필터 지우기

ho to apply upper boundary for cumulaitive percentage

조회 수: 1 (최근 30일)
liyana nadirah
liyana nadirah 2020년 1월 31일
댓글: Pravin Jagtap 2020년 2월 4일
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
Rik
Rik 2020년 1월 31일
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 2020년 2월 4일
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

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by