Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MATLAB QUESTION SOLVE USING MATLAB PROGRAM The general solution to the differential equation dxdy=17x2x28cos(x) is y(x)=217x232x38sin(x)+Cwithy(0)=C. The goal of this exercise is to write a
MATLAB QUESTION SOLVE USING MATLAB PROGRAM
The general solution to the differential equation dxdy=17x2x28cos(x) is y(x)=217x232x38sin(x)+Cwithy(0)=C. The goal of this exercise is to write a script file to plot the solutions to the differential equation in the interval 0x5, with initial conditions y(0)=60,100,140. The script file should have the structure script+function (similarly to the M-file myplot2.m Example 2). Call the file ex5.m. The function that defines y(x) must be included in the same file (note that the function defining y(x) will have two input arguments: x and C ). Your M-file should have the following structure (fill in all the ?? with the appropriate commands): x=??;% define the vector x in the interval [0,5] y1=f(??);% compute the solution with C=60 y2 =f(??);% compute the solution with C=100 y3 =f(??);% compute the solution with C = 140 plot(??) \% plot the three solutions with different line-styles title(??) % add a title legend(??) \% add a legend function y =f(x,C) y = ?? % fill-in with the expresion for the general solution end Plot the graphs in the same window and use different color and/or line-styles for each graph. To plot the graphs in the same window you can use the command hold on or use the plot command similarly to Exercise 4. Add the title 'Solutions to dy/dx=17x2x28cos(x) '. Add a legend with the list of C values used for each graph. (Type help plot for a list of the different line-styles, and help legend for help on how to add a legend.) Include both the M-file and the plot in your report. NOTE: the only output of the script file should be the graph of the three curves. Make sure you use enough points so that the curves are nice and smoothStep 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