Function minimization 0 solutions submitted (max: Unlimited) Find the minimum of
ID: 3716426 • Letter: F
Question
Function minimization 0 solutions submitted (max: Unlimited) Find the minimum of the following function within the bounds [-2 pi,2pi] f(x) = (x-?-cosx Store your result in a variable myfmin Your answer should have at least three significant figures, accurate to within 0.1% Eg. 1.23 and 3.33 e both have three significant figures.) You should review how to write functions in 'fzero and fplot: prefixing a statement with (x), you can write the function in the same line symbolically, rather than needing a separate file. Do that here. Your Script C Reset MATLAB Documentation 1 yEx; Assessment Submit Test 1Explanation / Answer
fminsearch(fun,x0) starts at the point x0 and attempts to find a local minimum x of the function described in fun.
fun = @(x)(x-pi).^2 - cos(x);
x0 = [-2*pi,2*pi];
myfmin = fminsearch(fun,x0)
Thanks, let me know if there is any concern.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.