To Be Done Only in MatLab
Please use the format provided:
MATLAB Code:
close all
clear
clc
h = 0.01;
x = -2:h:2;
f = (x.^2) .* exp(-x.^2);
g = diff(f)/h;
plot(x,f), xlabel('x'), ylabel('f(x)'), title('f(x)')
figure
x(length(x)) = [];
plot(x,g), xlabel('x'), ylabel('g(x)'), title('g(x)')
Plots:
To Be Done Only in MatLab Please use the format provided: The derivative can be computed numerically using the definiti...
To Be Done Only in MatLab
Please use the format provided:
Integrals can be computed numerically using the Reimann sum definition. ゞrxldr ~-ofu.h where h = 부 when N is large, x, is the discretized points between a and b. For example the integral of f(x)2 for 03x3 2 is done by N-100; a-0 b 2; h -(b-a)/N; x-a:h:b; sum(f*h); F = The resulting value is 2.7068, compared to the exact solution 2.6667. Use the above technique to compute the...
To Be Done Only in MatLab
Please use the format provided:
Symbolic integration in Matlab can be done Syms x int(f) For the definite integral, for example from 0 to 1 is den by intlf,0,1) Use this toolbox to find the integrals of g(x)=(x2+ 1)sin (x), G(x)=Js(x)dr Plot the function Glx) andgx) Your Script ¥ MATLAB Documentation Reset 1 syms X plot ) 7 figure fplot() Run Script
Symbolic integration in Matlab can be done Syms x int(f) For the...
please i need the requiered MATLAB script to solve this. All
calculations need to be done in matlab please
Design Layout References Mailings Review View Share 1) (15 points) Calculate the following for the function f(x) = e-a-x a. Use calculus to determine the correct value of the derivative. b. Develop an M-file function to evaluate the centered finite-difference approximations, starting with x = 0.5 Thus, for the first evaluation, the x values for the centered difference approximation will be...
Matlab: please answer all 3 parts and show steps using Matlab
inputs ONLY thank you
Problem 3. Consider the function f(x) ei cos(2x). (1) Sketch its graph over the interval [0, r] by the following commands: (2) Using h-001 to compute the difference quotient for x = π/6 in [0, π]. The commands are: And the difference quotient is: (3) Using h = 0.01 to approximate the second derivative by computing the difífquo for x = π/6 in [0, π]....
Please can you solve it using MATLAB.
(1) Generate random signals [n] and hn, each of length N, and measure the time it takes to compute the linear convolution of r[n using the linear convolution definition and using the FFT method . Plot a graph of the results for N 104 to 10 in steps of 10. (2) Consider the signal x[n]-cos(0.3n),。£11S 100. Generate a plot of: ·The magnitude and phase of the DTFT of x[n] for 0 2π The...
MATLAB WORK PLEASE
The upward velocity of a rocket can be computed from the following formula: v=u* In mo -91 mo-91 where v = upward velocity, u = the velocity at which fuel is expelled relative to the rocket, me = the initial mass of the rocket at time t=0,9 = the fuel consumption rate, and g = the acceleration due to gravity. Compute the time tro at which v reaches an arbitrary value using the bisection method. Use the...
Please
help me with this short, matlab/diffy q project.. teacher said it’s
supposed to be a short code
Matlab Project Recall that we can approximate the time derivative of a function y(t) at time tn as dt ΔΙ This follows from the limit definition of the derivative and gives the approximate slope of the function y(t) at time tn If we think about 'stepping through time from some initial time to a later time in steps of size At, then...
the code in the photo for this I.V.P
dy/dx= x+y. y(0)=1
i need the two in the photo
thank you
New folder Bookmarks G Google dy/dx x+y, y(0)=1 2 h Exact Solution 1.8 Approximate Solution Mesh Points 1.6 -Direction Fied 1.4 1.2 1 0.8 04 0.2 0.3 0.1 0 X CAUsersleskandara\Desktop\New folder emo.m EDITOR PUBLISH VEW Run Section FILE NAVIGATE EDIT Breakpoints Run Run and FL Advance Run and Advance Time BREAKPOINTS RUN 1 - clear all 2 clc 3-...
14.13 (a) only
Spreadsheet from HW 3:
Manning:
1. Numerically solve for the normal depth using either MS-Excel or Matlab. Hint: your spreadsheet for critical depth in HW3 is a good place to start. 14.13 The channel in Problem 14.7 is excavated in smooth rock to a bed slope of 0.2%. Deter- mine the (a) normal depth of flow, (b) critical slope, and (c) state of flow in the channel. 14.7 A trapezoidal channel has a bed width of 3.5...