Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
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)

Respuesta aceptada

Star Strider
Star Strider el 1 de Feb. de 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)

Más respuestas (0)

Categorías

Más información sobre Structures en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by