(i) x(t) ¼ 10 sin(2πt) cos (πt  4) for 10  t  10 in matlab

To plot the function x(t) = 10sin(2pi*t)cos(pit/4) in MATLAB, you can follow these steps:

  1. Define a vector t with the desired range of values:
main.m
t = linspace(10, 10, 1000); % create 1000 equally spaced points between 10 and 10
82 chars
2 lines

Note: Since the range you have mentioned is from 10 to 10, I assumed it as a typo and used the same value of 10 to plot. Please modify the range if needed.

  1. Calculate the values of x(t) using the defined t vector:
main.m
x = 10*sin(2*pi*t).*cos(pi*t/4);
33 chars
2 lines
  1. Plot the waveform using the plot function:
main.m
plot(t, x);
12 chars
2 lines
  1. Add labels and title to the plot for better understanding:
main.m
xlabel('Time (t)');
ylabel('Amplitude');
title('Plot of x(t) = 10*sin(2*pi*t)*cos(pi*t/4)');
93 chars
4 lines

Putting it all together, the MATLAB code to plot the waveform would be:

main.m
t = linspace(10, 10, 1000);
x = 10*sin(2*pi*t).*cos(pi*t/4);
plot(t, x);
xlabel('Time (t)');
ylabel('Amplitude');
title('Plot of x(t) = 10*sin(2*pi*t)*cos(pi*t/4)');
166 chars
7 lines

This code will generate a plot of x(t) over the given range of t, which in this case is from 10 to 10.

related categories

gistlibby LogSnag