error - "Attempted to access w(0.000542549); index must be a positive integer or logical."
古いコメントを表示
I am writing a code to find the gain of a tranversal filter. I am getting the error - "Attempted to access w(0.000542549); index must be a positive integer or logical." The code is shown below:
del_L = 10;
del_Lambda = 1550*10^(-9);
D = 35;
rho_D = D*del_L*del_Lambda
% n_Lambda = input('Enter the refractive index of the fiber core');
n_Lambda = 1.46;
c = 3*10^8;%Speed of light
rho_d = (del_L*n_Lambda)/c;
a = rho_d+rho_D
for f=8:0.1:12.5
w = abs(2*3.14*f)
H0 = mod(1+cos(w(rho_d+rho_D)),0)/2
end
Please help!
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Resizing and Reshaping Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!