Can we store multiple subplots under one dataframe?

I was curious to know whether we can store the multiple subplots under one data frame, by which only by running that particular dataframe we will achive those saved subplots in it.
For an example, I've attached a code (its a small part from my project). Here as we can see, there are 4 subplots. Now, is there any possible way out to store these four subplots under one data frame so that next time we want these plots we all need to run that specific dataframe and not required to run this entire code.
b=rgb2gray(a);
BW1 = edge(b,'Canny');
BW2 = edge(b,'Sobel');
BW3 = edge(b,'Prewitt');
BW4 = edge(b,'roberts');
figure()
subplot(2,2,1);
imshow(BW1)
title("Canny");
subplot(2,2,2);
imshow(BW2)
title("Sobel");
subplot(2,2,3);
imshow(BW3)
title("Prewitt")
subplot(2,2,4);
imshow(BW4)
title("Roberts")

댓글 수: 1

If you are going to unaccept because the answer did not work for you, then it would help a lot if you were to discuss what did not work for you.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2022년 7월 6일

0 개 추천

You can savefig() to save the figure, and openfig() the figure later.
The result would depend upon the value of a at the time that you did the savefig() . It would not act as some kind of "macro" to generate the images based upon whatever a value existed at the time you did the openfig()

카테고리

제품

릴리스

R2022a

질문:

2022년 7월 6일

댓글:

2022년 7월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by