how i can solve this problem? unrecognized function or variable to run my code

5 visualizaciones (últimos 30 días)
Actually i want to plot 5g free space propagation loss in different operating frequency. So i got the problem that i mentioned above when i tried to run the code.
here is my code.
% Define the operating frequencies in Hz
freqs = linspace(1e9, 6e9, 100); % 100 equally spaced frequencies between 1 GHz and 6 GHz
% Define the distance between the transmitter and receiver in meters
distance = 100;
% Define the speed of light in meters per second
c = 3e8;
% Calculate the free space propagation loss in decibels (dB)
L_fs = (lambda / (4 * pi * d)).^2;% Free space path loss in dB
% Plot the results
plot(freqs/1e9, fspl);
title('Total Free Space Signal Attenuation vs. Operating Frequency');
xlabel('Operating Frequency (GHz)');
ylabel('Total Free Space Signal Attenuation (dB)');
grid on;

Respuestas (1)

KSSV
KSSV el 28 de Mzo. de 2023
I think this is what you need.
% Define the operating frequencies in Hz
freqs = linspace(1e9, 6e9, 100); % 100 equally spaced frequencies between 1 GHz and 6 GHz
% Define the distance between the transmitter and receiver in meters
distance = 100;
% Define the speed of light in meters per second
c = 3e8;
% Calculate the free space propagation loss in decibels (dB)
% L_fs = (lambda / (4 * pi * d)).^2;% Free space path loss in dB
L_fs = (freqs / (4 * pi * distance)).^2;% Free space path loss in dB
% Plot the results
plot(freqs/1e9, L_fs);
title('Total Free Space Signal Attenuation vs. Operating Frequency');
xlabel('Operating Frequency (GHz)');
ylabel('Total Free Space Signal Attenuation (dB)');
grid on;

Categorías

Más información sobre Measurements and Feature Extraction en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by