フィルターのクリア

Commands for plot and subplot

28 ビュー (過去 30 日間)
Nidhi Nagar
Nidhi Nagar 2022 年 1 月 27 日
コメント済み: Nidhi Nagar 2022 年 1 月 27 日
Examine the code given below in MATLAB: subplot(3,1,1); plot(t,x); subplot(3,1,2); plot(t,y); subplot(3,1,3); plot (t,z); What is the output of the above code? What do subplot and plot commands do?

採用された回答

Arif Hoq
Arif Hoq 2022 年 1 月 27 日
編集済み: Arif Hoq 2022 年 1 月 27 日
Subplot: Subplot divides the current figure into row,column and the figure position.
Plot: plot creates a 2 dimension(X axes vs Y axes) figure or line plot
please check this example:
t= 0:pi/100:2*pi;
x=sin(t);
y=cos(t);
z=x+y;
figure(1)
subplot(3,1,1) % means divided into 3 row, 1 column and creats into position 1
plot(t,x) % a=X values and X is you expected output or Y axes value
subplot(3,1,2) % means divided into 3 row, 1 column and creats into position 2
plot(t,y)
subplot(3,1,3) % means divided into 3 row, 1 column and creats into position 3
plot(t,z)
if you want more please type in the command prompt:
doc plot
doc subplot
  1 件のコメント
Nidhi Nagar
Nidhi Nagar 2022 年 1 月 27 日
Got it, Thank you so much..!!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSubplots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by