Question: MATLAB Problem. Please help. I know based on Chegg's policy that you can only answer 4 parts of a question but please help with what

MATLAB Problem. Please help. I know based on Chegg's policy that you can only answer 4 parts of a question but please help with what you can. MATLAB Problem. Please help. I know based on Chegg's policy that you

can only answer 4 parts of a question but please help with

what you can. 1. The Split-and-Average Problem. In class, we discussed the

1. The Split-and-Average Problem. In class, we discussed the split-and-average approach to subdivide and smooth the surfaces we encounter in many engineering disciplines. In this problem, you will write two separate functions to experiment with this algorithm. (a) Write a function that performs the splitting process. It must use exactly the function header shown below, where the function name and number of inputs and outputs must be followed exactly. function ( xs ] - splitPts( x ) As discussed in class, the output of splitPts is a vector with twice the number of elements as x, where midpoints are inserted every other element with a value equal to the average of the neighboring elements. For example: X = (1,5, 8] XS = [1, 3, 5, 6.5, 8, 4.5] Note that the midpoint inserted at xs (6) requires data from its left neighbor, xs (5), and right neighbor, xs (1), assuming the vector "wraps around" itself. (b) Write a function that performs the average process. It must use exactly the function header shown below, were the function name and number and order- ing of inputs and outputs must be followed exactly. function ( xa ] = averagePts ( xs, w) As shown in the lecture slides, the elements of xa are formed by calculating the weighted average of the three nearest neighbors, including the current element itself. xa(k) =W1 x xs(k-1) + W2 X xs(k) + W3 X XS(k+1) (1) Where w1, W2, W3 are the elements of the [1x3] input vector w after normaliza- tion, i.e., W1 = w(1)/sum(w). As in the splitting function, we will assume that the vector wraps around on itself, such that xs (1) and xs (n) are adjacent. An error should be produced from within your averagePts function if the sum of the three weights is equal to zero. Negative values are acceptable (and can produce some really interesting fractal results) but the sum of all three cannot be zero. (C) Use your splitts and averagePts functions to repeatedly split and average a set of x points and y points of your own choosing. Plot the initial distribution of points as unconnected nodes, e.g. plot (x,y, 'bo'). Repeat the process of splitting and averaging until the maximum node displacement after a single split-and-average iteration is less than 1 x 10-3 (i.e. max(Vdx2 + dy?)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!