I don't know how to fix this
조회 수: 2 (최근 30일)
이전 댓글 표시
this is my code: % Radar system parameters
frequency = 3e9; % Example frequency (in Hz)
bandwidth = 100e6; % Example bandwidth (in Hz)
waveform_bandwidth = 10e6; % Example waveform bandwidth (in Hz)
% Phased array antenna parameters
element_spacing_x = 0.5; % Example element spacing along x-axis (in meters)
element_spacing_y = 0.01; % A very small and positive value for element spacing along y-axis
num_elements = 10; % Number of array elements
% Ensure the Size parameter meets the requirement for the phased array
if num_elements < 2
error('Number of array elements must be at least 2.');
end
% Call the run_radar_simulation function with the provided radar parameters
radar_params = [frequency; bandwidth; waveform_bandwidth; 1; 2]; % Radar parameters
rx_pulses = coderun_radar_simulation(radar_params);
% Plot the received signals
figure;
subplot(2, 1, 1);
plot(real(rx_pulses));
title('Received Signal (Real Part)');
subplot(2, 1, 2);
plot(angle(rx_pulses));
title('Received Signal Phase');
% Custom platform and target objects
platform = [1000; 0; 0]; % Initial position and velocity
target = [1; 1; 10; 10]; % Target position and RCS and this is my error and i dont get it!!!
Output argument "rx_pulses" (and possibly others) not assigned a value in the execution with
"coderun_radar_simulation" function.
Error in run_radar_simulation (line 19)
rx_pulses = coderun_radar_simulation(radar_params);
what should i do?
댓글 수: 0
답변 (1개)
Cris LaPierre
2024년 2월 7일
The issue appears to be in your function coderun_radar_simulation, which has not been shared. You are trying to capture the outputof your function to rx_pulses, but as the error message states, your function is not returning any values.
댓글 수: 2
Cris LaPierre
2024년 2월 8일
편집: Cris LaPierre
2024년 2월 9일
Here's an example of what causes this error. Note that the function returns a variable out, but inside the function, I never assign a value to out.
y = fun(3)
function out = fun(in)
z = 2*in;
end
The fix is to assign a value to the output variable. That might look like this.
function out = fun(in)
z = 2*in;
out = z;
end
참고 항목
카테고리
Help Center 및 File Exchange에서 Detection, Range and Doppler Estimation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!