Plotting the behavior of a diagonal matrix

조회 수: 1 (최근 30일)
Dushani Munasinghe
Dushani Munasinghe 2019년 12월 30일
댓글: Csaba 2020년 1월 2일
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
KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 12월 30일
편집: KALYAN ACHARJYA 2019년 12월 30일
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 2020년 1월 2일
You have only vectors in your code, there is no matrix. What are you referring to?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by