how i can solve this problem? unrecognized function or variable to run my code
조회 수: 14 (최근 30일)
이전 댓글 표시
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;
댓글 수: 0
답변 (1개)
KSSV
2023년 3월 28일
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;
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Measurements and Feature Extraction에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
