필터 지우기
필터 지우기

How do i add the time and mass as variables to simulate

조회 수: 2 (최근 30일)
Sohail Nadeem
Sohail Nadeem 2019년 2월 27일
이동: Sabin 2023년 1월 5일
The concentration of insulin at any time is described by the equation:
C = C0e^(−40t/m)
where C0 is the initial concentration of insulin, t is the time in minutes, and m is the mass of the subject in kg.
My task is to simulate the insulin concentration for two people weighing 60kg and 100kg for 4 minutes in intervals of 10 seconds to then plot the graph.
Ive never seen a problem like this before so if you have any simular examples or if you could be willing to explain how i involve the masses and time it would be very helpful,
This is my code so far
C0 = 85;
Cins =@(M,t) C0*exp(-40*t./m);
M1 = 60
M2 =100
  댓글 수: 5
Sohail Nadeem
Sohail Nadeem 2019년 2월 27일
C0 = 85; %pmol/L Initial Insulin concentration
Cins =@(M,t) C0*exp(-40*t./M);
t = (0 : 10 : 4*60)/60; %minutes
M = (60,100);
C = Cins(M,t);
The graph should plot two lines of time against C from 10 seconds to 240 seconds in intervals of 10 seconds.
Does this look correct? Thank you.
Sohail Nadeem
Sohail Nadeem 2019년 2월 27일
If this is correct would i use a 'for loop' to get the values of M for plotting? This is the only thing i can think of!

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

답변 (1개)

Walter Roberson
Walter Roberson 2019년 2월 28일
이동: Sabin 2023년 1월 5일
That is not valid syntax for the assignment to M. But if you are using R2016b or later, then
M = [60; 100];
would give you useful results in C.
  댓글 수: 1
Sohail Nadeem
Sohail Nadeem 2019년 2월 28일
이동: Sabin 2023년 1월 5일
Thank you so much for your help!

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

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by