Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Do all the following in one script below. _sin (5x) + cos (5x)_2 Consider the functions f(x) = 2e-*sin? (10x) - cos? (10x)) and g(x)

image text in transcribed

Do all the following in one script below. _sin (5x) + cos (5x)_2 Consider the functions f(x) = 2e-*sin? (10x) - cos? (10x)) and g(x) =! 3. a) Assign x to a row vector of 75 points evenly distributed between 0 and including these endpoints. Do not display. b) Compute f (x) at each of the points in part (a), storing the result in a vector y fo the same dimensions. Do not display c) Compute g(x) at each of the points in part (a), storing the result in a vector z of the same dimensions. Do not display. d) Use fprintf to display the first 5 elements of y as a column, where the field width of each number is 8 with 4 digits to the right of the decimal point. e) Generate a 5x5 matrix of all 10's, setting the result to M1. Do not display. f) Now, display only the matrix values of M1 (without showing "M1" or "ans"), making sure to show it in it's original 5x5 form (as opposed to one column, etc.) g) Matrix multiply M1 by the column vector displayed in part (d), assigning the final result to variable M2. Do not display. h) Use fprintf to display the second element of M2, where the field width is 15 with 1 digit to the right of the decimal point, and left-justified. Before the number, include the message "The second element of M2 is:" i) Output a single plot that has all the following features: - a graph of x vs y, where each point is connected by a dotted line - a graph of x Vs Z, where each point is connected by a solid line - in addition, each point on the y graph is marked by an x - in addition, each point on the z graph is marked by an circle. - the x-axis is labeled "Independent Variable" - the y-axis is labeled "Dependent Variable" - a legend that labels the y graph as "f(x)' and the z graph as "g(x)" - a grid is overlaid on the entire plot - the domain on the horizontal axis is (1,3); the range on the vertical axis is [-1,3]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions