声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1182|回复: 3

[GUI界面] 请大家帮我看看这个程序如何修改

[复制链接]
发表于 2009-1-7 10:59 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
function pushbutton1_Callback(hObject, eventdata, handles)
%绘制高程曲线
global str
axes(handles.axes1)
width=1200:400:4000;%x
depth=1200:400:3600;%y
height=str;
wi=1200:50:4000;
di=1200:50:3600;
di=di';
zcubic=interp2(width,depth,height,wi,di,'cubic');
%在二维上标注等高线
[C,H]=contour(wi,di,zcubic);
clabel(C,H)
xlabel('Width')
ylabel('Depth')
title('在二维上标注等高线')
function pushbutton5_Callback(hObject, eventdata, handles)
%选择图片路径
global str
[filename,pathname]=uigetfile(['*.txt';],'读取数据');
str=imread(str);
handles.data=data;
回复
分享到:

使用道具 举报

发表于 2009-1-7 19:32 | 显示全部楼层

回复 楼主 huxuemin2008 的帖子

请问出现什么问题了?
 楼主| 发表于 2009-1-8 14:57 | 显示全部楼层
pushbutton5 读取的数据无法传递给pushbutton1 进行画图
C,H]=contour(wi,di,zcubic);有错误
 楼主| 发表于 2009-1-8 16:43 | 显示全部楼层
Reference to non-existent field 'output'.
Error in ==> xianshi>xianshi_OutputFcn at 75
varargout{1} = handles.output;
Error in ==> gui_mainfcn at 186
        feval(gui_State.gui_OutputFcn, gui_hFigure, [], gui_Handles);
Error in ==> xianshi at 44
    gui_mainfcn(gui_State, varargin{:});
??? Undefined function or variable "str".
Error in ==> xianshi>pushbutton5_Callback at 181
str=stread(str);
Error in ==> gui_mainfcn at 75
        feval(varargin{:});
Error in ==> xianshi at 44
    gui_mainfcn(gui_State, varargin{:});
??? Error while evaluating uicontrol Callback.
这是提示的错误信息
我编这个程序的目的是读取任意的txt文件
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-22 21:26 , Processed in 0.057783 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表