Effacer les filtres
Effacer les filtres

help!! Error:In an assignment A(I) = B, the number of elements in B and I must be the same.

1 vue (au cours des 30 derniers jours)
clear all;
close all;
L_0=10; %Average outer scale of turbulance in m.
c_n=5*10^(-12); %Structure constant of refractive index in m^-2/3.
c=300000000; % Speed of light in m/s.
f=20*10^9; % Frequency in HZ.
lamda=c/f;
L=100:100:5000;%Equivalent Path length through the turbulence area
%del_ky=0.01;
for i=length(L)
sigma(i)=((0.307*(c_n)^2)*((2*3.1416/lamda)^(1.17))*(L.^(1.833)))-((0.742*(c_n)^2)*((2*23.1416/lamda)^(0.17))*((L.^(2.833))*(L_0^2)))
end
semilogy(sigma,L)

Réponse acceptée

Star Strider
Star Strider le 1 Fév 2016
You can do this using ‘vectorised’ code without the loop:
L_0=10; %Average outer scale of turbulance in m.
c_n=5*10^(-12); %Structure constant of refractive index in m^-2/3.
c=300000000; % Speed of light in m/s.
f=20*10^9; % Frequency in HZ.
lamda=c/f;
L=100:100:5000;%Equivalent Path length through the turbulence area
%del_ky=0.01;
sigma = ((0.307*(c_n)^2)*((2*3.1416/lamda)^(1.17))*(L.^(1.833)))-((0.742*(c_n)^2)*((2*23.1416/lamda)^(0.17))*((L.^(2.833))*(L_0^2)));
semilogy(sigma,L)

Plus de réponses (0)

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by