
![close all clear MATLAB Code: clc A= [1 0 1; 0 0 0;00-1]; % Coefficient Matrix Xo = [5 76]; % Initial condition V, D = eig(A)](http://img.homeworklib.com/questions/f5d38840-b9f1-11ea-a2c6-a52e02d2a7f7.png?x-oss-process=image/resize,w_560)
Modified MATLAB Code:
close all
clear
clc
A = [1 0 1; 0 0 0; 0 0 -1]; % Coefficient Matrix
X0 = [5 7 6]'; % Initial condition
[V, D] = eig(A); % Get the Eigen values and Eigen vectors
% General Solution: X = Sum of {c_i * exp(L_i * t) * V_i}
% where c_i are constants, L_i are Eigen values and V_i are Eigen
vectors
%
% At t = 0:
% X = X0 = Sum of {c_i * V_i}
% We need to solve the system V*C = X0, where C = [c_1, c_2, ...,
c_i, ...]'
C = V\X0;
disp('Solution, X(t) =')
X = 0; syms t
for i = 1:length(A)
X = X + C(i) * exp(D(i,i)*t) * V(:,i); % Sum of {c_i * exp(L_i * t)
* V_i}
end
X = simplify(X);
disp(X)
% Plotting
figure, hold on
t_vals = 0:0.001:2;
for i = 1:length(A)
plot(t_vals, subs(X(i), t_vals), 'DisplayName', sprintf('%s',
X(i))) % Plot each solution
end
xlabel('t'), ylabel('X(t)'), title('Solution of ODE')
hold off
legend('Location', 'northwest')
Output:
Solution, X(t) =
8*exp(t) - 3*exp(-t)
7
6*exp(-t)
Plot:

help me please , By using MATLAB How can I plot the solution of linear diffrential...
MATLAB ONLY!! PLEASE WRITE IN COMPUTER SO I CAN COPY
PASTE!!! ANSWER COMPLETELY, USE FOR LOOPS.
THE PROGRAM TO BE MODIFIED IS THE NEXT ONE:
clc
clear
% Approximate the value of e ^ x using the Taylor Series
x = input( 'Enter the value of x for e^x. x = ' );
t = input( 'Enter the amount of desired terms. t = ' );
i = 1;
e_taylor = 0; % initializing the variable for the
accumulator
while...
Need help with this simple MATLAB code. I'm trying to plot a new set of Y values from input X values. I get an error that says: "not enough input arguments." clear all clc close all Q = 3.44E+18; D = 1.51E-17; t = 7200; x = [1E-6 2E-6 2.5E-6 3E-6 4.32E-6]; y = Q/sqrt((pi*D*t))*exp^(-(x)^2/(4*D*t)) plot(x,y, '*r') xlabel('Depth'), ylabel('Concentration')
How can I plot this function in MATLAB?? trap( -5, 5, 50) function area = trap(x0, xn, N) f=@(x) (6.*(exp(-x)).*(cos(x)).^2); h = ((xn-x0)/N); area=0; while (x0 area = area+(h/2)*(f(x0)+f(x0+h)); x0= x0+h; end fprintf('area of trap', area); end
Study the provided MATLAB programs entitled fft_spectrum, plot_fft_spectrum, and test_fft_spectrum. Using the program test_fft_spectrum, plot the approximate magnitude and phase spectra of the functions given in problem 3.2-1. Adjust your time axis so that the frequency plots are scaled conveniently, and important features of the time and frequency plots are clearly visible. This can be done by experimenting with the values of N, tmin, and tmax. And the 3.2-1 problems are: (a) pi(t/3) (b) Delta (3x/100) (c) pi (t-5/4) (d)...
MATLAB question I need the code
exactly as you would write it in MATLAB. thank you
1. Consider a Gaussian solution of the traveling-wave form ψ(z,t)-exp(-a(z-vt)2). The parameter values are a 1, 2. (a) Explain the physical meaning of these parameters (eg. what would happen if we took a = 10 instead?) Determine the direction of propagation of this solution: Is it traweling to the left or to the right? (2pts) (b) Write a Matlab code to plot the Gaussian...
For MATLAB users. Can you please type the answers for the MATLAB
sections.
Consider the RLC circuit where R - 5, C- 1, L- 4 and Vs - 8 1. Use circuit analysis laws to show that the resistor's voltage and induc- tor's voltage can be modelled as the system of ODEs Vi VL RC 2. Solve the eigenvalues and eigenvectors of the coefficient matrix in the system of ODEs. 3. Verify your answer for question (2) by using the...
I NEED THE MATLAB CODE NOT THE ANALYTICAL SOLUTION !!!!
using ZIR and 5.1 Use Matlab to find and plot the total response for the differential equation ZSR approach. (D2 +5D 6)y(t)x() where x(t) e-2t sin( 10t) u(t), and the initial conditions are: yo (0)-1 and уо (0)-2.
I need the code written in Matlab software to send a number of bits using the Pulse Shape Modulation, and demodulate the signal using the correlation coefficient. The part that i need to modified is the part that is in Bold. The two functions are : function [outSignals,time] = modulation(inBits) and function [outBits] = demodulation(inSignals). %% Main Function function runComm_code() clear;clc; SNRdB = 0:0.5:26; nBits = 1e6; SNRdBLength = length(SNRdB); Pe = ones(1,SNRdBLength); clc; disp('Simulation...
Can somebody help me with my matlab code? I am plotting the POWER SPECTRAL DENSITY OF Manchester, Polar, UNIPOLAR, and BIPOLAR. It wont run. The error I am getting is "incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform element wise multiplication, use '.*'. " clc; clear all; %Declaration of variables bandwidth = 1; total_bandwidth = 1/bandwidth; f = 0:.05*bandwidth:2*total_bandwidth; x=f*total_bandwidth; %Manchester Power...
Please include the MATLAB code in the solution. I have no idea
how to plot part ii and part iii.
1ス ppt i).write fhe analy fc oltin Ar x(t), (hint:do this frog ts", ‘m ii) Also obtain analytical solution using Laplace transforms ompare plet of this with the result in i above obtained using impulse response of this
1ス ppt i).write fhe analy fc oltin Ar x(t), (hint:do this frog ts", ‘m ii) Also obtain analytical solution using Laplace transforms...