problems coding to find function values
이전 댓글 표시
Hello
I'm a biology student trying to use matlab, my mathematical and informatic knowledge is thereby limited. However I've tried to write some code to obtain the following:
I have a function y=f(t) that describes the growth of every individual. y=f(t) has 8 variables that are constant but are different for each individual. The velocity curve is obtained by differentiating the y=f(t) function. a picture of both the growth and velocity curve can be seen below. The red curve is the growth curve and the blue curve the velocity curve.
the function is described by y(t)= m1*(1-1/(1+(m2*(m0+m8))^m5+(m3*(m0+m8))^m6+(m4*(m0+m8))^m7)). t is here the independent variable. m1 to m8 are variables that are constant for each individual but differ between individuals.
What I would like to obtain is -the inflection points (both t and f(t) values) of the growth function - the asymptotic value of the growth function - the corresponding maximum height of the differentiated function - the minimum height of the differentiated function before the maximum height is reached

If tried to write some code trying to obtain all the information listed above. However there seem to be some bugs. If anybody is willing to help me out I would be very gratefull
if true
% code
% set variabelen
syms t;
m1=xlsread('jongens0','A1:A10');
m2=xlsread('jongens0','B1:B10');
m3=xlsread('jongens0','C1:C10');
m4=xlsread('jongens0','D1:D10');
m5=xlsread('jongens0','E1:E10');
m6=xlsread('jongens0','F1:F10');
m7=xlsread('jongens0','G1:G10');
m8=xlsread('jongens0','H1:H10');
% set loop
for i=1:10
% define function and differentiated function
y(i)=m1(i).*(1-1./(1+(m2(i).*(t+m8(i))).^m5(i)+(m3(i).*(t+m8(i))).^m6(i)+(m4(i).*(t+m8(i))).^m7(i)));
dy(i)=diff(y(i))./dt;
% information extraction
a=max(dy(i));
b=fminsearch(dy(i),x0,[0,a]);
c=max(y(i));
d=limit(y(i),inf);
e=inflect_pt((y(i)));
A = [a b c d e]
% write information to excel
xlswrite('output0',A)
end
댓글 수: 1
Muthu Annamalai
2013년 6월 19일
편집: Muthu Annamalai
2013년 6월 19일
Good progress sofar! You seem quite close to your said target.
You want to lookup the following functions, in MATLAB,
- doc diff %- to differentiate a signal to identify its maxima, minima, etc
- doc min %min and max of a signal/vector
- doc max %max
- doc abs %absolute value
- doc interp1 %interpolate the signal for better derivates - advanced use -Using a combination of these functions you should be able to find inflexion points or derivatives.
Goodluck.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!