2. Write a Matlab function that accepts a vector of values and returns a vector of derivatives at those points. You can assume that the values are given on an equally spaced array with spacing h. Use the two point central difference formula df dx = fi+1 − fi−1 2h for all points except the two endpoints. For the endpoints use a one-sided derivative that uses two points. The function should have the form
a) How many logs are in the stack?
Determine the weeks earnings for an employee from the hourly paid rate and hours worths for the rate.report the gross earnings(including overtime earnings) for the week.
Create the following matrix by assigning vectors with constant spacing to the rows (use the linspace command for the third row). Do not type individual elements explicitly.
A =
1.0000 2.0000 3.0000 4.0000 5.0000 6.0000
7.0000 6.0000 5.0000 4.0000 3.0000 2.0000
2.0000 3.1667 4.3333 5.5000 6.6667 9.0000
Solve the following system of six linear equations on MatLAB:
2a-4b+5c-3.5d +1.8 e + 4 f= 52.52
-1.5 a + 3b +4c-d-2e +5f= -21.1
5a+b-6c+3d -2e +2 f = -27.6
1.2a 2b +3c+4d-e+4f=9.16
4a+b-2c-3d-4e+1.5 f= - 17.9
3a+b-c+4d-2e-4 f= -16.2
Write a function that draws a circle on the coordinate plane.
The MATLAB function should use a,b r inputs, where a and b are the x-axis and y-axis coordinates of the center of the circle and the radius being r.
Add the labels to axes and annotation (a,b) at the center of the circle.
(use the parametric equation of a circle).
You are given the price list of certain equipment (Table 1).
Write a script or function that takes an input for the number of items from each equipment and calculates the total number of equipment, total cost, and average cost per item.
(Table 1: Price List: )
Equipment Price (£)
Power generator 30
Transformer 10
Stepper motor 15
DC motor 8.5
Write a script of function that will take an input as the total budget and calculate how many items can be purchased for each equipment
On the first day of the month, 4 customers come to a restaurant. Afterwards, those 4 customers come to the same restaurant once in 2,4,6 and 8 days respectively.
a). On which day of the month, will all the four customers come back to the restaurant together?
A digital filter is described by difference equation y(n) −2.56y(n −1)+2.22y(n−2)−0.65y(n−3) = x(n)+x(n−3) where x(n) is the input and y(n) is the output. Assume all zero initial conditions. a) Generate the input signal x(n), which is a sinusoid of frequency F1 sampled at Fsamp. Plot five cycles of sinusoidal signal. b) Find the output by implementing the difference equation. c) Reconstruct the signal using formula Xr = also analyze the Sin[π(t−kT)/T] N−1 k=0 x(kT)Sin[π(t − kT)/T] [π(t − kT)/T] [π(t−kT)/T] term interpolation process. d) Downsample the input sinusoidal sequence by a factor of 2. Plot the time-domain signal. e) Plot the spectrum of the downsampled signal in the interval (−π,π). What frequency in Hz does π represent? f) Upsample the input sinusoidal sequence by a factor of 3. Plot the time-domain signal. g) Plot the spectrum of upsampled signal in the interval (−π,π). What frequency in Hz does π represent now?