What does this mean exactly

조회 수: 2 (최근 30일)
Amber Kollmar
Amber Kollmar 2018년 4월 17일
댓글: Stephen23 2018년 4월 18일
So me and my group have taken the divided difference method to do our project. We are using x0 as the population of Tigers and y0 as the area of the forest(s). What does it mean for our D value to come out as the same for the first group but the others are different. I will not lie this class has been confusing to me......I am needing to pretty much explain the results that we came up with. This is our code and what we got as as a result.
function D = tiger( x0, y0 )
y0=[765 850 975 1022 1100 ];
x0=[8 10 13 23 25];
D = zeros(size(x0));
m = length(x0);
D = y0;
Do = D;
for k=2:m
for i=k:m
D(i)=(Do(i)-Do(i-1))/(x0(i)-x0(i-(k-1)));
end
Do=D;
end
end
Results:
tiger
ans =
765.0000 42.5000 -0.1667 -0.1785 0.0329

답변 (1개)

Bob Thompson
Bob Thompson 2018년 4월 17일
D(1) does not change because you have k = 2:m, so the lowest value i can ever be is k=2.
Are you sure that x0(i-(k-1)) is correct? I admit that I have not used the divided difference method or equation before, but it seems odd to me the difference between i and k-1 should become greater with each loop.
Also, what type of class is this for? An explanation of why something is a certain way can be very different for a prob and stats class vs an economics class, even if the math appears very similar.
  댓글 수: 1
Stephen23
Stephen23 2018년 4월 18일
Amber Kollmar's "Answer" moved here:
yes x0(i-(k-1)) is correct this is the code we did in class for a class project. The class is Introduction to Numerical Analysis. We have to do a project over a real world issue so we choose tigers that are on the verge of being extinct. He told use to use the area of the forest and the population of the tigers after we told him what we choose to do. My issue is me and my partner are confused as to what do the D values actually mean?

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

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by