How to plot the following figures?
1 次查看(过去 30 天)
显示 更早的评论
I am a new user and I am looking a help to plot the following figures. Thanks
- 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.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
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Axis Labels 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!