You want to buy three kinds of vitamin supplements that will give you enough amo
ID: 3538694 • Letter: Y
Question
You want to buy three kinds of vitamin supplements that will give you enough amount of your desire. Supplement I has 1 mg of vitamin A, 3 mg of vitamin B, and 4 mg of vitamin C. Supplement II has 2, 3, and 5 of each types of vitamin respectively while Supplement III has 3, 0, and 3, respectively. You want to have 11 mg of vitamin A, 9 mg of vitamin B, and 20 mg of vitamin C. How many of each supplement will precisely provide these amounts of vitamins?
Solve this in MATLAB using the Jacobi's method.
Explanation / Answer
function[J]=jacobFD(f,x,delx) [m n]=size(x); for j=1:m xx=x; xx(j)=x(j)+delx; J(:,j) = (f(xx)-f(x))/delx; end;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.