Plotting the behavior of a diagonal matrix
1 回表示 (過去 30 日間)
古いコメントを表示
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
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
2020 年 1 月 2 日
You have only vectors in your code, there is no matrix. What are you referring to?
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Operating on Diagonal Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!