matlab中subplot畫圖的問題

2022-01-31 09:13:37 字數 3475 閱讀 6243

1樓:匿名使用者

畫在一個圖裡,用

plot(x1,y1,x2,y2,x3,y3,x4,y4)你要它們成2x2分佈,就把座標移動一下,至於位置根據具體情況自己定例如----------------------------plot(subs(x1,x1+1),subs(y1,y1+1),subs(x2,x2-1),subs(y2,y2+1),subs(x3,x3+1),subs(y3,y3-1),subs(x4,x4-1),subs(y4,y4-1))

2樓:匿名使用者

clcclear all

x1=[1 2 3];x2=x1;x3=x2;x4=x1;

y1=[2 4 6];y2=2*y1;y3=3*y1;y4=4*y1;

subplot(2,2,1)

plot(x1,y1);

axis([0,20,0,20])

subplot(2,2,2)

plot(x2,y2);

axis([0,20,0,20])

subplot(2,2,3)

plot(x3,y3)

axis([0,20,0,20])

subplot(2,2,4)

plot(x4,y4)

axis([0,20,0,20])

matlab subplot 畫圖的問題

3樓:

大神來了!程式按照下邊這麼寫(我自己虛擬了一個f1,f2,f3哈):

x=1:600;

f1=3*abs(sin(x));f2=f1;f3=f1;

h(1)=subplot(311);

plot(x,f1);

title('a點先正常後異常狀態');

k=-2*pi;

axis([k+2*pi,k+4*pi,0,10]);

grid on

h(2)=subplot(312);

plot(x,f2);

title('b點先正常後異常狀態');

k=-2*pi;

axis([k+2*pi,k+4*pi,0,10]);

grid on

h(3)=subplot(313);

plot(x,f3);

title('c點先正常後異常狀態');

k=-2*pi;

axis([k+2*pi,k+4*pi,0,10]);

grid on

linkaxes(h,'x');

while 1

if k>max(x)

break;

endk=k+0.1;

axis([k+2*pi,k+4*pi,0,10]); %移動座標系pause(0.1);

end效果圖:

4樓:匿名使用者

subplot(311); 改為 subplot(3,1,1);

subplot(312); 改為 subplot(3,1,2);

subplot(313); 改為 subplot(3,1,3);

matlab用subplot畫圖,怎麼加總標題

5樓:木生子識時務

你用suptitle命令即可。下面是該命令的幫助文件。

suptitle('text') adds text to the top of the figure

above all subplots (a "super title"). use this function

after all subplot commands.

下面是一個例子,注意,最好畫完所有的子圖後再用suptitle,不然可能會出現和第一個子圖的標題覆蓋的情況。

clc;clear;close all

x = 0:0.01:4*pi;

y1 = cos(x);

y2 = sin(x);

figure(1)

subplot(2,1,1);

plot(x,y1);

title('cos(x)');

subplot(2,1,2);

plot(x,y2);

title('sin(x)');

suptitle('總標題')

下面是結果:

6樓:大頭禕禕

用sgtitle('總標題')

這個語句要寫在**最後。比如:

figure()

subplot(2,1,1)

title('子標題1')

subplot(2,1,2)

title('子標題2')

sgtitle('總標題')

不知道是不是版本問題(我用的2018b), suptitle 會報錯

如何將matlab中每個迴圈生成的圖畫在subplot不同的子圖裡

7樓:匿名使用者

w=[0,pi/8,pi/4,pi/2,pi,7*pi/4,15*pi/8,2*pi];

n=0:99;

for i=1:8

x=cos(n.*w(i));

subplot(4,2,i)

plot(n,x)end

8樓:匿名使用者

function draw()

n=0:99;

w=[0,pi/8,pi/4,pi/2,pi,7*pi/4,15*pi/8,2*pi];

for i=1:8

x=cos(n.*w(i));

subplot(2,4,i);

% subplot(4,2,i);

plot(n,x,'k-');

endend

matlab subplot 影象排版

9樓:匿名使用者

可以控制子圖的大小和位置。

給你一個例子吧。

h=subplot(1,2,1)

set(h,'position',[0.3 0.1100 0.1347 0.8150]) %四個引數分別是子圖的x位置,y位置,寬度,高度

plot(1:10);

h=subplot(1,2,2)

set(h,'position',[0.7 0.3100 0.1 0.5150]) %四個引數分別是子圖的x位置,y位置,寬度,高度

plot(sin(0:0.01:2*pi));

**********==

看了你的例子,我覺得你最好,畫成兩個2*2的。

因為四個的圖示放不下。

10樓:匿名使用者

你也可以一張張畫,然後用別的軟體比如photoshop排版 ,特別是在確定座標有困難的時候。

如果有很多張圖,每張圖都有多個subplot,還是用matlab程式來畫,一勞永逸。

matlab畫散點圖及圓,用matlab畫散點圖

scatter x,y,s 即可,s是大小 用matlab畫散點圖 1 首先,我們開啟matlab軟體,在命令列視窗中輸入 help plot 看一下plot函式的使用方法。2 輸入a 12 34 45 22 8 16 17 19 52 33 42 18 3 輸入 plot a 1,a 2,用陣列的...

大家好!matlab中畫柱面的函式cylinder r,n

給你一個例子 t 0 pi 20 2 pi 產生一個向量 x,y,z cylinder 2 sin t 100 產生花瓶的三維網格資料surf x,y,z 繪製三維面圖 matlab中cylinder命令是什麼含義,如何應用 x,y,z cylinder x,y,z cylinder r r 半徑 ...

matlab中a什麼意思,matlab中a是什麼意思

賦值的意思 a 1 表示a的值是1 a hello 表示a的值是字串hello matlab中a 是什麼意思 5 a 是把矩陣a轉換為一個行向量,就是一行。例如 a rand 2,3 a 0.6925 0.3965 0.78020.5567 0.0616 0.3376 b a b 0.6925 0....