|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
求助: 想实现 点击界面按钮时就跳出对话框导入数据,
并将数据绘在axle上,程序如下:
function pushbutton8_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[FileName,PathName]=uigetfile('*.*','Select a single:');
fid=fopen(fileName,'r');
SS = fread(fid,inf,'single');
sigl=1000;
fs=10000;
beg=8;
x=1.0*30*ss(beg:sigl+beg-1);
t=1/fs:1/fs:sigl/fs;
axes(handles.axes3);
plot(t,x);xlabel('time/s');ylabel('Aceceration/m/s^2');
但老是出错,如下:
??? Undefined function or variable 'fileName'.
Error in ==> test2>pushbutton8_Callback at 101
fid=fopen(fileName,'r');
Error in ==> gui_mainfcn at 75
feval(varargin{:});
Error in ==> test2 at 42
gui_mainfcn(gui_State, varargin{:});
??? Error while evaluating uicontrol Callback.
请哪位帮我看看,谢谢!
[ 本帖最后由 eight 于 2007-7-16 11:23 编辑 ] |
|