How can i create two subplot

47 ビュー (過去 30 日間)
MdRezwan Parvez
MdRezwan Parvez 2019 年 3 月 23 日
コメント済み: Lesley Chingwena 2022 年 5 月 1 日
I am using a for loop which is giving me 16 plots. I want to put 8 in one subplot and the remaining 8 in the subplot 2. i am using the following code:
models{ct} = arx(ze1,[[na1_ na2_] [nb1_ nb2_] nk]);
if ct<10
figure(1)
s(1)=subplot(3,3,ct)
else
figure(2)
s(2)=subplot(3,3,ct)
end
unfortunately after putting 3 plots in subplot 1, matlab is giving me the following error:
"Error using subplot (line 327)
Index exceeds number of subplots"
how can i generate two subplots with 8 plot in each of them.
thanks
  1 件のコメント
Lesley Chingwena
Lesley Chingwena 2022 年 5 月 1 日
Hello, did you manage to find a solution for this? I am also trying to do something similar.

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

回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 3 月 24 日
% Figure 1
figure(1);
subplot(121), plot(test1);
subplot(122), plot(test2);
% Figure 2
figure(2);
subplot(121), plot(test3);
subplot(122), plot(test4);
%Please changes as per your requirements

カテゴリ

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