What does this mean exactly

2 Ansichten (letzte 30 Tage)
Amber Kollmar
Amber Kollmar am 17 Apr. 2018
Kommentiert: Stephen23 am 18 Apr. 2018
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

Antworten (1)

Bob Thompson
Bob Thompson am 17 Apr. 2018
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 Kommentar
Stephen23
Stephen23 am 18 Apr. 2018
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?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by