MATLAB CODE:
clc
clear all
close all
syms x
g(x) = x^5 - 5*x^4 + 5*x^3 + 5*x^2 - 6*x; % Given g(x)
Dg(x) = diff(g(x),x) == 0; % Differentiation
of g(x)
x_data = vpa(solve(Dg(x),x)); % x-values at which maxima and minima
exist
g_data = g(x_data); % Maxima and Minima of g(x)
fprintf('Maxima and Minima of g(x):\n\n')
disp(g_data)
fplot(x,g(x),[-2 4])
xlabel('x')
ylabel('g(x)')
title('Plot of g(x) in the interval -2 < x < 4')
grid on
x = [-2*pi;pi;0;pi;2*pi];
g = vpa(g(x));
fprintf('The 5 values of g(x) are:\n\n')
disp(g)
OUTPUT:
4. Given (x)=x-5x + 5x5x2 - 6x , write a symbolic MATLAB script that: (a) plots...
Write a MATLAB script to plot the function of f(x) given by: Write a MATLAB script to plot the function of f(x) given by: f(x) = integral x^2 - pi^2/4 x > pi/2 8 * cos x -pi/2 lessthanorequalto x lessthanorequalto pi/2 pi^2/4 - x^2 x < -pi/2
d) Given the primal problem Max z= 8x/+3x2+xz Subject to: x;+6x,+8x3<118 X, + 5x+10x<240 X1, X2,X3, 20 Write down its problem (5 marks) dual Question Nine R=622 R4 2 02. V-24V R = 422. R5=2.522. (a) What are the voltage across and the current in each of the resistors Ri through Rs in figure above? (6 Marks) (b) How much power is dissipated in R.? (4 marks)
Evaluate the function for the given values of x. (-5x+4, for x<-1 x) = ), 2 + 3 1, for -1 5x</ 2 for x (a) f(-1): (b) f(3)
4-6 on matlab 4. Write a program in a script file that determines the real roots of a quadratic equation ax2+bx+c 0 When the file runs, it asks the user to enter the values of the constants a, b, and c. To calculate the roots of the equation the program calculates the discriminant D, given by: D b2-4ac When D 0, the program displays message "The equation has two roots," and the roots are displayed in the next line. When...
2.6.17. The probability density function of the random variable X is given by 6x-21-3 -, 2<x<3 0, otherwise. Find the expected value of the random variable X.
– 5x – 2 2 <1 Given the function t(x) 4.x2 - 6x +3 1< I< 5 - 3+1 I > 5 Calculate the following values: t(0) t(5) = t(2) = t(10) t(9) = t(1) =
Q1 Given, f(x) = {x +1, 2 5x<4 4,0 < x < 2 (a) Sketch the graph of f(x) and its even half-range expansion. Then sketch THREE (3) full periods of the periodic function in the interval – 12 < x < 12. (b) Determine the Fourier cosine coefficients of Ql(a). (c) Write out f(x) in terms of Fourier coefficients you have found in Q1(b).
1) Write a script that plots sin(x), cos(x), tan(x) for x between 0 and 360◦ (or 2π radians) on one graph, adjusts the y axis to range between −10 and +10, and includes a legend identifying each line. 2)Write a Matlab function that sums up a specified number of odd-power terms from the Maclaurin series of sin(x) For example, if you use the function you wrote to sum the first 10 terms for x = 1, you should get 1...
(1 point) 6y 6xe-6x, 0 < x < 1 with initial condition y(0) = 2. Given the first order IVP y 0, х21 (1) Find the explicit solution on the interval 0 < x < 1 У(х) %3 (2) Find the lim y(x) = х—1 (3) Then find the explicit solution on the interval x 1 У(х) —
A periodic signal, x(t) is shown below. A = 10, T-4 sec. -T Write a MATLAB script to plot the signal, using enough points to get a smooth curve. Compute the Fourier series coefficients for the signal (if you can find them in the text, that is ok). Plot the single-sided or double-sided spectra for each signal. Include enough frequencies in the plots to adequately represent the frequency content of the signals. Plot partial sums of the Fourier series for...