MATLAB Answers

0

Put title for each subplot

Asked by Ting-Yu Chueh on 18 Sep 2019 at 16:28
Latest activity Commented on by Star Strider
on 19 Sep 2019 at 2:33
Dear all,
I want to put a subtitle for each subplt. I tried to do, but it didn't work out.
The code is below, Could anyone help me to fix the code? Thanks!
Titileindex=["Group effect" "Condition effect" "Group by Condition"];
Titileindex=["Group effect" "Condition effect" "Group by Condition"];
figure;
for i= 1:3
subplot(3,1,i);
title ('Titleindex(i)');
end

  0 Comments

Sign in to comment.

1 Answer

Star Strider
Answer by Star Strider
on 18 Sep 2019 at 16:32
 Accepted Answer

Remove the single quotes:
title (Titleindex(i));
and spell the name correctly in both the variable and references to it!

  2 Comments

Ting-Yu Chueh on 19 Sep 2019 at 2:02
Thanks~
Star Strider
on 19 Sep 2019 at 2:33
As always, my pleasure!

Sign in to comment.