天天看點

MATLAB讀取mat資料并繪圖

close all;  
clear all;
clc;  
m=load('a.mat');//a是一個結構體類型的mat資料
n=load('b.mat');
y = m.pr_cruve(:,1);//pr_cruve是結構體a中的矩陣部分的資料,擷取第一列的資料作為縱坐标
x = m.pr_cruve(:,2);//擷取第二列的資料作為縱坐标
Y = n.pr_cruve(:,1);
X = n.pr_cruve(:,2);
plot (x,y,'*-',X,Y,'o-');
axis([0,1,0,1]);
           

繼續閱讀