matlab中如何在M文件中调用MAT数据

我有一M 程序文件
load xy.mat
t=signals(1,:); %读取时间信号
f=signals(2,:); %读取作用力F信号
x=signals(3,:); %读取精确模型中的小车位置信号
q=signals(4,:); %读取精确模型中的倒立摆摆角信号
xx=signals(5,:); %读取简化模型中的小车位置信号
qq=signals(6,:); %读取简化模型中的倒立摆摆角信号
%Drawing control and x (t) response signals
%画出在控制力作用下的系统响应曲线
%定义曲线的横纵坐标、标题、坐标范围和曲线的颜色等特征
figure(1) %定义第一个图形
hf =line (t,f(:));
grid on;
xlabel ('Time (s)')
ylabel ('Force (N)')
axis([0 1 0 0.12])
axet=axes('Position',get(gca,'Position'),...
'XAxisLocation','bottom',...
'YaxisLocation','right','Color','None',...
'XColor','k','YColor','k');
h t =line (t,x,'color','r''parent',axet);
h t =line (t,xx,'color','r''parent',axet);
ylabel ('Evolution of the x position (m)')
axis ([0 1 0 0.1])
title ('Respomse x and x''in meter to a f(t)pulse of 0.1 N')
gtext ('\ leftarrow f (t)', gtext('x (t) \rightarrow'),gtext('\leftarrow x''(t)')
% drawing control and theat (t) respomse singals
figure(2)
hf=line (t,f(:));
grid on
xlabel ('Time')
ylabel('Force in N')
axis ([0 1 0 0.12])
axet=axes('Position',get(gca,'Position'),...
'XAxisLocation','bottom',...
'YaxisLocation','right','Color','None',...
'XColor','k','YColor','k');
ht=line (t,q,'color','r''parent',axet);
ht=line (t,qq,'color','r''parent',axet);
ylabel ('Angle evolution (red)')
axis ([0 1 -0.3 0])
title ('Respomse \theta(t) and \theta' '(t)in red to af(t)pulse of 0.1N')
gtext ('\ leftarrow f (t)', gtext('\theta(t)\rightarrow'),gtext('\leftarrow \theta''(t)')

请问怎样调用mat数据啊?
本人比较小白求详解

第1个回答  2013-06-19
把xy.mat文件放到你程序同一路径下就可以了。本回答被提问者采纳
相似回答