当前位置:编程学习 > Matlab >>

matlab gui界面设计,设计一个按钮,要求按下就可以读入图片(从几幅图中选择),怎么做,回调函数怎样

追问:
popupmenu的回调函数该怎么写,要求是可以弹出两个选项,单击一个选项就可以给黑白图片加上一种噪声。谢谢先
答案:% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global im
 
[filename pathname] = ...
uigetfile({'*.jpg';'*.bmp';'*.gif'}, '开始');

str=[pathname filename];
 
im=imread(str);
axes(handles.axes1);
imshow(im);
其他:uigetfile 

上一个:matlab用autocorr画自相关函数图是不是最多画20个点
下一个:Matlab绘制复杂连续信号的波形函数如图:(菜鸟求解决如何输入函数)

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,