MATLAB Answers

How to plot the following figures?

17 ビュー (過去 30 日間)
Hyacinthe Nshuti
Hyacinthe Nshuti 2021 年 1 月 17 日
コメント済み: Hyacinthe Nshuti 2021 年 1 月 18 日
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!

  0 件のコメント

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2021 年 1 月 17 日
編集済み: Image Analyst 2021 年 1 月 17 日
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.

  1 件のコメント

Hyacinthe Nshuti
Hyacinthe Nshuti 2021 年 1 月 18 日
Thanks for your answer.
wish u the best!

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by