Question: 3. Problem 3 - Create a MATLAB script file HW1P3.m that contains the following elements a. Create a vector x that contains values such that

3. Problem 3 - Create a MATLAB script file HW1P3.m that contains the following elements a. Create a vector x that contains values such that -4 SX S4 b. Create a vectory that contains values such that -4 Sy S4 c. Use the function meshgrid() and the vectors x and y to create a 2D grid of values stored in X and Y d. Create a matrix m that represents the differential equation (below) using element-wise operations dY X m = dx Y e. Create the matrix L that calculates the length of each "vector m". Refer to the L calculation from problem 2 f. Use the function quiver() to draw a field of arrows drawn on the grid defined by Xan Y using the normalized values 1/L and m/L (with element-wise operations) g. Add the command axis square h. Save the figure using a function in MATLAB 3. Problem 3 - Create a MATLAB script file HW1P3.m that contains the following elements a. Create a vector x that contains values such that -4 SX S4 b. Create a vectory that contains values such that -4 Sy S4 c. Use the function meshgrid() and the vectors x and y to create a 2D grid of values stored in X and Y d. Create a matrix m that represents the differential equation (below) using element-wise operations dY X m = dx Y e. Create the matrix L that calculates the length of each "vector m". Refer to the L calculation from problem 2 f. Use the function quiver() to draw a field of arrows drawn on the grid defined by Xan Y using the normalized values 1/L and m/L (with element-wise operations) g. Add the command axis square h. Save the figure using a function in MATLAB
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
