Plotting the behavior of a diagonal matrix

1 visualización (últimos 30 días)
Dushani Munasinghe
Dushani Munasinghe el 30 de Dic. de 2019
Comentada: Csaba el 2 de En. de 2020
I have a diagonal matrix of N th power. Eventhough I plot the variation of matrix element with N, I am not getting the expected plot. Basically I want to find the variation of diagonal matrix with power N when eigen decomposition is performed.
The code is,
clc;
close all;
clear all;
%parameters
c=3*10^8;
lambda_0=1559*10^(-9);
lambda_p=1560.7*10^(-9);
lambda_s=1580*10^(-9);
gamma=0.011;
d_slope=0.03e3;
d_slope1=-0.10e3;
P_p=1;
L=250;
%range
m=1:100;
%equations.
delta_beta=((-2*pi*c)/lambda_0^2)*d_slope*(lambda_p -lambda_0 )*(lambda_p -lambda_s).^2;
k=delta_beta+2*gamma*P_p;
g = ((-delta_beta).*(delta_beta./4+gamma*P_p)).^(1/2);
for j=1:length(m);
D(j)=(1./(g.^(m(j)))).*(g.*cosh(g.*L)+sinh(g.*L).*(sqrt(gamma*P_p^2-(k./2).^2))).^(m(j));
end
plot(m,D);
  2 comentarios
KALYAN ACHARJYA
KALYAN ACHARJYA el 30 de Dic. de 2019
Editada: KALYAN ACHARJYA el 30 de Dic. de 2019
Are you refering diagonal elements of D matix? Though D is not a square matrix, how you expression the diagonal elements?
>> whos D
Name Size Bytes Class Attributes
D 1x100 800 double
What about n, in the code there is no N/n, is it m?
Csaba
Csaba el 2 de En. de 2020
You have only vectors in your code, there is no matrix. What are you referring to?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Operating on Diagonal Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by