Question
You have to use MATLAB to solve these questions. Please answer these 5 questions!
ercise 1: pae). eate a graph of y cos4x over [0, n]. To illustrate what happens when there are too few points in your domain, first try a step size of n/ 10 1. Which command gives the desired values for x? Select exactiy one of the cholices 2. Which command gives the correct answer for Select exactly one of the choice y - cos(4x) y cos4x y cos(4 x) 3. Plot your graph with the plot command. You dont need to turn it in. 4. Redo your plot, thi s time using the command 2x-linspace(e,pi) to define the x array. Which plot looks more like the plot of a cosine curve? Select exactty one of the choices. The first one。 the second one . both of them Exercise 2 we wish to plot the function fx) ecoat) over the interval to,2n]. 1. What command generates a sufficient number of values for >? Select exactly one of the choices linspace(e,2pi) inspace(,108,2pi) 012*pl:0.e1 2. Which command will generate the corresponding y values Select exactly one of the chbices exp cos() s(x)expcos()) exp)cos()
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1)- when we define a vector using syntax such as,

x = 0:pi/10:pi

It returns a row vector starting with 0 and last value being pi, with total 10 values each at equal interval as pi/10.

Hence x = 0 pi/10 2pi/10 3pi/10 4pi/10 5pi/10........pi

Whereas if syntax is given as option 2, which is not feasible, hence will return error.

Command linspace also works almost same but with little different syntax. For example if x =linspace(0,pi)

It will return a row vector dimension of 100 with linearly divided intervals between 0 and pi. Which means more values and hence more smother plot for y.

2)- correct syntax for this equations is y=cos(4*x)

3)- command for plotting is as follows.

%define x vector

x = 0:pi/10:pi;

y = cos(4*x);

plot(y,x)

4)- if we define x with linspace command, we will have more closer data points and inturn it will produce plot with closer to cosine curve.

x=linspace(0,pi);

y=cos(4*x);

plot(y,x)

2.1)- it is already explained earlier both option 1 and 2 will produce more data points .

2.2)-exp(cos(x))

Add a comment
Know the answer?
Add Answer to:
You have to use MATLAB to solve these questions. Please answer these 5 questions! ercise 1:...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT