PART B Suppose we want to minimize the value of y given by the function -0.25 t
ID: 3676726 • Letter: P
Question
PART B
Suppose we want to minimize the value of y given by the function -0.25 t To do so in Matlab, a stub function m-file named PopQuiz8.m has been created and contains the following bare-bones function definition function PopQuiz8 () end Edit and build upon the stub function m-file so that: . the primary function of PopQuiz8.m takes the scalar value of t as an input .the primary function of PopQuiz8.m returns a handle pointing to a function which will evaluate and return the above mathematical function for y, given the scalar co-efficients a,b,c as inputs .PopQuiz8.m also contains the function definition for the function pointed to by the handle described aboveExplanation / Answer
function r = PopQuiz8(a,b,c,t)
r = @minimy;
miny = fminsearch(r,1)
end
function f = minimy(a,b,c,t)
f = a*t^3+b*cos(t)-c*exp(-0.25*t);
end
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.