subplot中如何给每个子图命名?。

조회 수: 9 (최근 30일)
pijonex
pijonex 2022년 11월 21일
답변: jikolil 2022년 11월 21일
用subplot分了四个图 但是运行的时候只出图 没有title, 而且提示:missing variable or function . 我的程序如下 ,大家帮看一下。我看到有人提出同样问题,下面有人回答说给subplot加个句柄 a=subplot() 我试了一下 依然不显示标题sqrt_snr=3;
init=126424;
[x,xn]=wnoise(2,19,sqrt_snr,init);
figure,a=subplot(2,2,1);plot(x)
title(‘初始信号’)
axis square
figure,b=subplot(2,2,2);plot(xn)
title(‘含噪信号’)
axis square

채택된 답변

jikolil
jikolil 2022년 11월 21일
这会不会是软件的问题。这样执行就是有的(MATLAB2013a)。
% https://www.ilovematlab.cn/thread-292179-1-1.html
% candice0507
% 2014/05/17 18:26:03
clear
clc
%%
sqrt_snr=3;
init=126424;
[x,xn]=wnoise(2,19,sqrt_snr,init);
%% plot
figure
a = subplot(2,2,1);plot(x)
title('initial signal')
axis square
b = subplot(2,2,2);plot(xn)
title('signal with noise')
axis square

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!