I keep getting an error can someone help please
function bacteria1 numIterations = 24; t = 0:numIterations; N = zeros(size(t)); N(1) = 1; N0 = 1; T = 1/3; for i=(1:numIterations) N(i+1)= N0.*(2.^(t./T)) end plot(t,N,'-o'); xlabel('t') ylabel('N')

댓글 수: 2

madhan ravi
madhan ravi 2018년 10월 25일
What’s T?
Muhammad Ali
Muhammad Ali 2018년 10월 25일
T is doubling time of the bacteria it’s 20 mins i converted to hours so 1/3

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

 채택된 답변

Image Analyst
Image Analyst 2018년 10월 25일

0 개 추천

I think you might want this:
numIterations = 24;
t = 0:numIterations;
N = zeros(size(t));
N(1) = 1;
N0 = 1;
T = 1/3;
for i=(1:numIterations)
N(i+1)= N0.*(2.^(t(i)./T))
end
plot(t,N,'-o');
xlabel('t')
ylabel('N')
grid on;

추가 답변 (1개)

madhan ravi
madhan ravi 2018년 10월 25일

1 개 추천

function bacteria1
numIterations = 24;
T=1/3
t = 0:numIterations;
N = zeros(size(t));
N(1) = 1;
N0 = 1;
N=N0.*(2.^(t./T))
plot(t,N,'-o');
xlabel('t')
ylabel('N')
end

카테고리

도움말 센터File Exchange에서 Error Functions에 대해 자세히 알아보기

질문:

2018년 10월 25일

댓글:

2018년 10월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by