- Convert the angles from degrees to radians.
- Define the time vector.
- Compute the sine values for the given angles and frequency.
- Plot the sine waves.
i want to plot sin 27 degree and 26.94 amd frequency 108.25MHz i dont know how to plot help me pls.
1 次查看(过去 30 天)
显示 更早的评论
i want to plot sin 27 degree and 26.94 amd frequency 108.25MHz i dont know how to plot help me pls. it is difference phase and frequncy equal t
0 个评论
回答(1 个)
Amith
2024-8-8
Hi Thananthorn,
To plot the sine waves for the angles 27 degrees and 26.94 degrees with a frequency of 108.25 MHz in MATLAB, you can follow these steps:
Please refer to the code example below for more insight on to the steps (assuming values) :
% Define the angles in degrees
angle1_deg = 27;
angle2_deg = 26.94;
% Convert the angles to radians
angle1_rad = deg2rad(angle1_deg);
angle2_rad = deg2rad(angle2_deg);
% Define the frequency in Hz (108.25 MHz)
frequency = 108.25e6;
% Define the time vector
% Let's plot for a duration that covers a few periods of the sine wave
duration = 1e-6; % 1 microsecond
sampling_rate = 1e9; % 1 GHz sampling rate
t = 0:1/sampling_rate:duration;
% Compute the sine values
y1 = sin(2 * pi * frequency * t + angle1_rad);
y2 = sin(2 * pi * frequency * t + angle2_rad);
% Plot the sine waves
figure;
plot(t, y1, 'b', 'DisplayName', '27 degrees');
hold on;
plot(t, y2, 'r', 'DisplayName', '26.94 degrees');
hold off;
% Add labels and legend
xlabel('Time (seconds)');
ylabel('Amplitude');
title('Sine Waves for 27 degrees and 26.94 degrees with 108.25 MHz Frequency');
legend show;
grid on;
Hope this helps!
1 个评论
Steven Lord
2024-8-8
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!