How to plot the following figures?

1 view (last 30 days)
Hyacinthe Nshuti
Hyacinthe Nshuti on 17 Jan 2021
Commented: Hyacinthe Nshuti on 18 Jan 2021
I am a new user and I am looking a help to plot the following figures. Thanks
  1. 1.1. Create a 2 by 2 grid of subplots (i.e., a figure with several plots)! On each subplot plot a random pair of complex conjugates from the unit circle (Z = 1*exp(1j*2*pi*rand(4,1)) using black circles (plot(real(Z(1)), imag(Z(1)), 'ko'), etc.)!
  1. 1.2. Create a plot: x-axis label is ‘time [s]’, y-axis label is ‘temperature [C]’, and (time, temperature) samples are plotted as red stars ('r*'). Four time instances are at regular interval from 0 to 10. Use linspace to create them. The respective temperature samples are: (15, 14, 10, -1). Set the axis scales appropriately in the M file using xlim and ylim commands!

Answers (1)

Image Analyst
Image Analyst on 17 Jan 2021
Edited: Image Analyst on 17 Jan 2021
For 1.1, did you look up how subplot() works in the help? If you had, you would have learned this:
subplot(2, 2, 1);
plot(real(Z), real(Z), 'ko', 'LineWidth', 2);
grid on;
subplot(2, 2, 2);
plot(real(Z), imag(Z), 'ko', 'LineWidth', 2);
grid on;
subplot(2, 2, 3);
plot(
subplot(2, 2, 4);
plot(
Question 1.2 is the same -- did you look up ylabel(), linspace(), and ylim() in the help? It should be really easy and straightforward after you do.

Community Treasure Hunt

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

Start Hunting!