How to make subplots from plots generated from toolbox functions.
5 views (last 30 days)
Show older comments
Hi everyone,
I would like to make figures with subplots that are generated from a toolbox function. I use a function from the signal processing toolbox as an example. Here are two plots that plot separately into their own figures:
if true
% code
load train
findchangepts(y,'MaxNumChanges',6,'Statistic','rms');
figure
findchangepts(y,'MaxNumChanges',6);
end
and here is my attempt at putting them into one figure:
if true
% code
load train
p1=findchangepts(y,'MaxNumChanges',6,'Statistic','rms');
figure
p2=findchangepts(y,'MaxNumChanges',6);
subplot(2,1,1)
plot(p1)
title('first')
subplot(2,1,2)
plot(p2)
title('second')
end
the failed figure I get is:

thanks in advance.
1 Comment
Mohamed Nedal
on 24 Dec 2019
Edited: Mohamed Nedal
on 24 Dec 2019
Hi, I'm looking for an answer for your quesion too but what I know is that p1 and p2 here return the index at which the mean of x changes most significantly. So I think plotting p1 and p2 is meaningless.
Answers (0)
See Also
Categories
Find more on Subplots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!