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))
You have to use MATLAB to solve these questions. Please answer these 5 questions! ercise 1:...
Exercise 1: Use Matlab command to obtain the following a) Extract the fourth row of the matrix generated by magic(6) b) Show the results of 'x' multiply by 'y' and 'y' divides by 'x'. Given x = [0:0.1:1.1] and y=[10:21] c) Generate random matrix 'r' of size 4 by 5 with number varying between -8 and 9 Exercise 2: Use MATLAB commands to get exactly as the figure shown below x=pi/2:pi/10:2*pi; y=sin(x); z=cos (x);
I have to write a Matlab function called "interpoly(x,y) which calculates the corresponding interpolation polynomial for given support points (xj,fj) with x=[x1,x2,...,xn] and f=[f1,f2,...,fn] and in interval x[min xj, max xj] plotted. Any method can be used to calculate the interpolation polynomial but I think Lagrange would be the best. One rule is that I can not use "polyfit" command.I have to test the programm with values of fj of the functions f(x)=cos(x) and f(x)=1/(1+x^2) each in the interval [-6,6]....
solve all questions simply by using matlab. write all step here please 1Normal 1 No Spac Heading1 Heading 2 DISCUSSION Solve all tasks given below: 1. Consider function f(x) 3.5-0.5x cos(6x) for the value of x between -2.0 until 4.0. Draw the plot in dash line and in red colour, Label the title and all axes. 2. Consider the following functions for 0sxS pi: x() 10e0.St sin(3t +2) y(t) 7e-04t cos(5t - 3) (a) Draw both graphs on the same...
Please answer the question and include matlab code and plots. Thank You Problem 1: The operation of signal dilation or decimation or down-sampling is defined by y(n) = x(nM) in which the sequence x(n) is down-sampled by an integer factor M. Explore Matlab’s downsample command to implement the above equation. Now generate x(n) = sin(0.125πn), for −50 ≤ n ≤ 50. Decimate x(n) by a factor of 4 to generate y(n). Plot both x(n) and y(n) using subplot and comment...
MATLAB, Please answer question 1. + ENGR 102 Homework 9 :- 1) An elliptical staircase that decreases in size with height can be modeled by the parametric equations: r cos(t) y-rsint) it m) Where, e-0.04t Ib cos(O)+ [a sin()]- a and b are the semimajor and semiminor axes of the ellipse, h is the staircase height, and n is the number pf revolutions that the staircase makes. Make a 3-D plot of the staircase with a 20 m, b 10...
please solve this in matlab platform, will solving write this mydata=importdata(‘’cars.txt’’,”|”,1) like this i hv the cars.txt data in my pc. Analyze the data in cars.txt which you have to download from the section of "Sinif Dosyalari on Ninova. [35 points] Write one script to answer all the parts. Save your script named as "final". a. There exists linearity between "length" and "curb". Plot the data in order to observe the 3. linearity b. Let "curb" be the dependent variable,...
just make circle questions which 2,(b) and 3,(i) thank you 2. (Polar Coordinates: Polar Plots). (a) Consider the curve given in polar coordinates (i) Use a scientific calculator to fill in the following table with the (approximations of) values of the function r(0) on π, π r(e) (the approximations of the values r(e) must be good to at least two decimal places). (i) Use the graph paper for the polar coordinate system (attached to the assignment sheet) to plot the...
please explain how to do step 5 in matlab commands. med at x=c. 2 The first derivative Ne Scr We investigate the function f(x) 4 12x3+9x2. >> x-linspace (-3,3) >> y-41x.^4-12*x.^3 >> plot (x,y), grid 9*x."2; + A plot over the interval I-3,3] reveals an apparent "flat section"' with no visible relati extrema. To produce a plot that reveals the true structure of the graph, we replot over the interval [-1,2]: >> x=linspace (-1,2); >> y= 4 * x. ^4-12*x.^3...
Please solve on only PART 2 b) and c) , PART 1 is only for REFERENCE :) Part I: Ene concept of a percentile (equivalently, quantile) is very important in data analysis. It applies to both samples and distributions. So, let's get some wi practice with them, starting with the binomial distribution. In prelab, you learned that the function gbinom(p. size prob) gives the p-th quantile of the binomial distribution with parameters n - size and pi prob. tocus on...
PLEASE USE MATLAB this problem you are trying to find an approximation to the periodic function /(t) esint-1) over one period, o <t < 2π. In t-linspace(0,2*pi,200)' and let b be a column vector of evaluations of f at those points. (a) Find the coefficients of the least squares fit In MATLAB, let (b) Find the coefficients of the least squares fit f(t)ndy+d2 cos(t)+ d, sin(t)+d, cos(2t)+dy sin(2t). (c) Plot the original function f(t)and the two approximations from (a) and...