Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(b) (3 points) In its simplest form, PLOT(X, Y,'-') plots a vector of values Y versus a vector of values X using a solid line.

image text in transcribed

(b) (3 points) In its simplest form, PLOT(X, Y,'-') plots a vector of values Y versus a vector of values X using a solid line. If '-' is replaced by ':' then the graph is drawn with a dotted line. See help plot for other options. The graph is drawn by connecting the points in X by a straight line, so if the points in X are quite dense, then the graph will appear as a smooth continuous curve. For example, the statements X-linspace (0,pi,100); Y-sin(X); plot(X,Y, '-') will open a graphics window with the graph of sinx plotted on the interval O' using 100 equally spaced data points. The graph of cos x could be drawn with a dotted line on the same graph as sinx on [0, by executing the following statements X1-linspace (0,pi,100); Y1-sin(X1); Y2-cos (X1); plot(X1,Y1,'-',X1,Y2,':') The functions sin x and cos x could be drawn on the same graph but on different intervals by specifying a different set of X values for each Use the MATLAB function plot to draw a graph of the spline constructed in (a) on the interval [0, 27] along with the function f(x) - sin2(x). So, f(x) and the 3 cubic polynomials should be drawn on one graph in the same graphics window The first cubic polynomial should be drawn with a dotted line on 10, , the second with a solid line on nd the third with a dotted line on As o 0 in this problem, the cubic polynomial in (*above could be plotted on 10, 21] with the following statements X1-linspace (0, 2*pi/3,50); Y1=c (1, 1) * (X1-0) .^3tc (1,2) * (X1-0) ."2+c (1,3)*(X1-0)to(1,4) ; plot(X1,Y1,'-') NOTE that must be replaced by the MATLAB operator ." for the cubed and squared powers in this expression because the argument X1 is a vector (rather than a scalar). This means that the exponentiation is done component wise to the entries in the vector X1; for example, if X - [1 2 3 4], then X. "2 is equal to [1 4 9 16], whereas X~2 is undefined DELIVERABLES: The statements you use to create the data to plot the orig- inal function and the spline function along with the plot itself (b) (3 points) In its simplest form, PLOT(X, Y,'-') plots a vector of values Y versus a vector of values X using a solid line. If '-' is replaced by ':' then the graph is drawn with a dotted line. See help plot for other options. The graph is drawn by connecting the points in X by a straight line, so if the points in X are quite dense, then the graph will appear as a smooth continuous curve. For example, the statements X-linspace (0,pi,100); Y-sin(X); plot(X,Y, '-') will open a graphics window with the graph of sinx plotted on the interval O' using 100 equally spaced data points. The graph of cos x could be drawn with a dotted line on the same graph as sinx on [0, by executing the following statements X1-linspace (0,pi,100); Y1-sin(X1); Y2-cos (X1); plot(X1,Y1,'-',X1,Y2,':') The functions sin x and cos x could be drawn on the same graph but on different intervals by specifying a different set of X values for each Use the MATLAB function plot to draw a graph of the spline constructed in (a) on the interval [0, 27] along with the function f(x) - sin2(x). So, f(x) and the 3 cubic polynomials should be drawn on one graph in the same graphics window The first cubic polynomial should be drawn with a dotted line on 10, , the second with a solid line on nd the third with a dotted line on As o 0 in this problem, the cubic polynomial in (*above could be plotted on 10, 21] with the following statements X1-linspace (0, 2*pi/3,50); Y1=c (1, 1) * (X1-0) .^3tc (1,2) * (X1-0) ."2+c (1,3)*(X1-0)to(1,4) ; plot(X1,Y1,'-') NOTE that must be replaced by the MATLAB operator ." for the cubed and squared powers in this expression because the argument X1 is a vector (rather than a scalar). This means that the exponentiation is done component wise to the entries in the vector X1; for example, if X - [1 2 3 4], then X. "2 is equal to [1 4 9 16], whereas X~2 is undefined DELIVERABLES: The statements you use to create the data to plot the orig- inal function and the spline function along with the plot itself

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions