IT1005. Lab session on week 13 (9 th /last meeting) After this, good bye…. Agenda. Review of Lab 8 Full review of IT1005 syllabus A very very quick review of fmincon. Mind mapping, in 10 minutes Past year paper discussion. Lab 8 - Review . Q1. A. fzero to find roots.
Lab session on week 13 (9th/last meeting)
After this, good bye…
Q1. A. fzero to find roots.
You are looking for positive root, then do not start fzero using negative guess, e.g. -1000?
Q1. B. fzero with parameter c. Plot c and roots.
Loop through various value of c, call fzero for each different c!
Q1. C. Use polyfit to fit the resulting plot of Q1. B.
4th or 5th order polynomial is already sufficient. This is a bit subjective though.
Q2. A. function that counts least square error of the y data and the y model.Geek version can be used here.
Q2. B. using fminsearch to find k1, k2, k3 that minimize the function value created in Q2. A.k1 = 5, k2 = -0.2, k3 = 7Your plot of y data and y model should more or less fit with each other!
How to use fmincon:
This is the “linear version”, the “first part” of the semester:
This is the “linear version”, the “second part” of the semester:
function retVal = fun_name(x)retVal(1) = do something with x(1);…retVal(numel(x)) = do something with x(numel(x));retVal = retVal’; % always return a column vector.
This is the “linear version”, link to the “future”: