clc,clearjquery
x=[11.9,11.5,14.5,15.2,15.9,16.3,14.6,12.9,15.8,14.1];數組
y=[196.84,196.84,197.14,197.03,197.05,197.13,197.04,196.96,196.95,196.98];函數
plot(x,y,'.')ui
Matlab將座標系中的點鏈接起來spa
U
V
R=V./(U+V)
%圖形展現出來
x=[1 2 3 4 5 6 7];
plot(x,U,'-.R*','LineWidth',2);
hold on;
plot(x,V,'-.G+','LineWidth',2);
hold on;
plot(x,R,'-.Mo','LineWidth',2);
%hold on;
%grid on;
xlabel('Number');
ylabel('Recognition rate (%)');blog
matlab:對單個矩陣plot繪圖的說明utf-8
實例:a=magic(5)
a =
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
plot(a)
grid onget
x=rand(10,1,40); % 隨機取40個數 一個當橫座標 一個當縱座標
y=rand(10,1,40);
%畫圖
plot(x( 1:10),y( 1:10),'r.');hold on; % 點 r=紅色
plot(x(11:20),y(11:20),'g*');hold on; % 星星 g=綠色
plot(x(21:30),y(21:30),'o');hold on; % 圓圈 默認是藍色
plot(x(31:40),y(31:40),'mo','MarkerSize',15) % 大大的圓圈 m=紫色
分別按行組和行列繪製三維條形圖input
Y = round(rand(5,3)*10); %隨機函數產生5*3的數組,對產生的數據取整it
subplot(2,2,1)
bar(Y,'group')
title 'Group'
subplot(2,2,2)
bar(Y,'stack') %堆型二維垂直條形圖
title 'Stack'
subplot(2,2,3)
barh(Y,'stack') %堆型二維水平條形圖
title 'Stack'
subplot(2,2,4)
bar(Y,1.5) %設定條形的寬度爲1.5
title 'Width = 1.5'
效果如圖
Y = [1 2 3 4 5 6 7;
1 2 3 4 3 2 1;
76 5 4 3 2 1];
subplot(3,2,1)
bar3(Y,'detached')
title('Detached')
subplot(3,2,2)
bar3(Y,0.25,'detached')
title('Width = 0.25')
subplot(3,2,3)
bar3(Y,'grouped')
title('Grouped')
subplot(3,2,4)
bar3(Y,0.5,'grouped')
title('Width = 0.5')
subplot(3,2,5)
bar3(Y,'stacked')
title('Stacked')
subplot(3,2,6)
bar3h(Y,0.3,'stacked')
title('Width = 0.3')
效果如圖
Matlab將座標系中的點鏈接起來