Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need help with a Matlab script. I currently do not have the data points, but how would I write the script for a random set
Need help with a Matlab script. I currently do not have the data points, but how would I write the script for a random set of points?
7 Polynomial function fitting One of the most fundamental examples of function approximation (known today as machine learning) is least squares polynomial fitting. The idea is to take a polynomial and choose such a set of values for (an, an-1, . . . , al ,ao) which best fits the data (taking the sum of squares of the distance between the approximation and each data point as the measure). Turns out, choosing those aj isn't that difficult and MATLAB has a function for it p - polyfit(x, y, order); where p is the set of coefficients ai, x, y are the data points and order is the order of the polynomial (e.g. 1 for linear and 2 for quadratic) Once we have the coefficients, we can evaluate the polynomial at new x values using y-polyval (p, x); where the parameters are as before and x can be a vector, making y a vector 7.1 Implementation Implement a script (not a function) that takes your fractal boundary points found in the previous part and fits a polynomial of order 15 to them Fit a polynomial of order 15 to your fractal boundary data points Remember to select only the points along the actual fractal. The boundary goes flat to the left and right of the fractal. Discard those points (by hand tuning the range of x). Plotting is very useful here
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started