⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 matlab.asv

📁 MATLAB简单应用
💻 ASV
字号:
function varargout = matlab(varargin)
% MATLAB M-file for matlab.fig
%      MATLAB, by itself, creates a new MATLAB or raises the existing
%      singleton*.
%
%      H = MATLAB returns the handle to a new MATLAB or the handle to
%      the existing singleton*.
%
%      MATLAB('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in MATLAB.M with the given input arguments.
%
%      MATLAB('Property','Value',...) creates a new MATLAB or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before matlab_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to matlab_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help matlab

% Last Modified by GUIDE v2.5 28-Nov-2008 21:45:14
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @matlab_OpeningFcn, ...
                   'gui_OutputFcn',  @matlab_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin & isstr(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before matlab is made visible.
function matlab_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to matlab (see VARARGIN)

% Choose default command line output for matlab
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes matlab wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = matlab_OutputFcn(hObject, eventdata, handles)
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes during object creation, after setting all properties.function edit1_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit1 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.%       See ISPC and COMPUTER.if ispc    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction edit1_Callback(hObject, eventdata, handles)% hObject    handle to edit1 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit1 as text%        str2double(get(hObject,'String')) returns contents of edit1 as a double% --- 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)[filename,pathname]=uigetfile({ '*.bmp;*.jpg;*.tif;*.png','All  Files(*.bmp,*.jpg,*.tif,*.png)' } ,'打开图象文件');
if filename==0
else
    set(handles.edit1,'string',[pathname,filename]);
end
file=imread([pathname,filename]);
axes(handles.axes1);
imshow(file);% --- Executes on button press in pushbutton2.function pushbutton2_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton2 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)Button=questdlg('确定退出?','请选择','确定','取消','确定');
switch Button
    case '确定'
        close matlab;
end% --- Executes during object creation, after setting all properties.function popupmenu1_CreateFcn(hObject, eventdata, handles)% hObject    handle to popupmenu1 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    empty - handles not created until after all CreateFcns called% Hint: popupmenu controls usually have a white background on Windows.%       See ISPC and COMPUTER.if ispc    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end% --- Executes on selection change in popupmenu1.function popupmenu1_Callback(hObject, eventdata, handles)% hObject    handle to popupmenu1 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns popupmenu1 contents as cell array%        contents{get(hObject,'Value')} returns selected item from popupmenu1val = get(hObject,'Value'); 
str = get(hObject, 'String'); 
%handles.listbox1是你的listbox的Tag
switch str{val};
case '图像隔行抽取' 
set(handles.edit2,'string',{''});
case '插值放大' 
set(handles.edit2,'string',{'本例采用“邻近点插值法”:在原来图像的每行每列后面加上左边和上面的一行像素值。实际上这样的处理方式将原来的一个像素点,变成灰度值大小相同的4个像素点。从而获得了数字图像在空间尺寸上的放大作用。'});
case '图像傅立叶变换' 
set(handles.edit2,'string',{'傅里叶变换是线性系统分析的一个有力工具,宏观世界能够定里地分析诸如数字化系统、采样点、电子放大器、卷积滤波器、噪音和显示点等的作用。通过实验培养这项技能,将有助于解决大多数图像处理问题。对任何想在工作中有效应用数字图像处理技术的人来说,把时间用在学习和掌握傅里变换上是很有必要的。'});
case '图像增强' 
set(handles.edit2,'string',{'图象增强是指按特定的需要突出一幅图象中的某些信息,同时,削弱或去除某些不需要的信息的处理方法。其主要目的是处理后的图象对某些特定的应用比原来的图象更加有效。图象增强技术主要有亮度对比度变换,直方图修改处理、图象尖锐化处理等。'});
case '图像的直方图' 
set(handles.edit2,'string',{'直方图是图象的最基本的统计特征,它反映的是图象的灰度值的分布情况.直方图操作能有效地用于图象增强.直方图均衡化的目的是使图象在整个灰度值动态变化范围内的分布均匀化,改善图象的亮度分布状态,增强图象的视觉效果.'});
case '图像加高斯噪声' 
set(handles.edit2,'string',{'高斯噪声又叫正态噪声,是最普通的一种噪声。'});
case '图像加椒盐噪声' 
set(handles.edit2,'string',{'椒盐噪声,是一种脉冲噪声,脉冲噪声总是数字化为最大值和最小值(纯白和纯黑)的形式对图像形成干扰。负脉冲以一个黑点出现在图像中,正脉冲以白点出现图像中,用“椒盐”这一词来进行比喻非常形象。'});
case '图像的平滑滤波' 
set(handles.edit2,'string',{'滤波的机理就是在待复原图像中逐点地移动掩模,滤波器在每一点(X,Y)处的响应通过事先定义的掩模内像素的关系来计算。'});
case '图像的中值滤波' 
set(handles.edit2,'string',{'滤波的机理就是在待复原图像中逐点地移动掩模,滤波器在每一点(X,Y)处的响应通过事先定义的掩模内像素的关系来计算。'});
case '图像的索引' 
set(handles.edit2,'string',{' 索引图像包括图像矩阵与颜色图数组,其中颜色图是按照图像颜色值进行排序后的数组。对于每一个像素,图像矩阵包含一个值,这个值就是颜色数据组中的索引。颜色图为M*3双精度值矩阵,各行分别指定RGB单色值。标准的颜色映射包含hsv,hot,cool,pink,bone,jet,copper等。本例只用到'});
case '图像隔行抽取' 
set(handles.edit2,'string',{''});
case '图像隔行抽取' 
set(handles.edit2,'string',{''});
case '图像隔行抽取' 
set(handles.edit2,'string',{''});
case '图像隔行抽取' 
set(handles.edit2,'string',{''});

end

% --- Executes on button press in pushbutton3.function pushbutton3_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton3 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)file=get(handles.edit1,'string');val=get(handles.popupmenu1,'value');

switch val;
case 1 
run gehang(file);
case 2 
run chazhi(file);
case 3 
run fuliye(file);
case 4 
run zengqiang(file);
case 5 
run zhi(file);
case 6 
run gau(file);
case 7
run jiaoyan(file);
case 8 
run pinghua(file);
case 9 
run zhongzhi(file);
case 10 
run yansehot(file);
case 11
run weicai(file);
end
% --- Executes during object creation, after setting all properties.function popupmenu2_CreateFcn(hObject, eventdata, handles)% hObject    handle to popupmenu2 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    empty - handles not created until after all CreateFcns called% Hint: popupmenu controls usually have a white background on Windows.%       See ISPC and COMPUTER.if ispc    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end% --- Executes on selection change in popupmenu2.function popupmenu2_Callback(hObject, eventdata, handles)% hObject    handle to popupmenu2 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns popupmenu2 contents as cell array%        contents{get(hObject,'Value')} returns selected item from popupmenu2val = get(hObject,'Value'); 
str = get(hObject, 'String'); 
%handles.listbox1是你的listbox的Tag
switch str{val};
case '1' 
set(handles.edit2,'string',{'hrrrrrrrrrrrrrrrrrrr'});
case '2' 
set(handles.edit2,'string',{'b','d'});
end% --- Executes on button press in pushbutton4.function pushbutton4_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton4 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)file=get(handles.edit1,'string');
val=get(handles.popupmenu2,'value');

switch val;
case 1 
run caitufengliang(file);
case 2 
run caituchongzu(file)
end
% --- Executes during object creation, after setting all properties.function listbox1_CreateFcn(hObject, eventdata, handles)% hObject    handle to listbox1 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    empty - handles not created until after all CreateFcns called% Hint: listbox controls usually have a white background on Windows.%       See ISPC and COMPUTER.if ispc    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end% --- Executes on selection change in listbox1.function listbox1_Callback(hObject, eventdata, handles)% hObject    handle to listbox1 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns listbox1 contents as cell array%        contents{get(hObject,'Value')} returns selected item from listbox1


% --- Executes during object creation, after setting all properties.function listbox2_CreateFcn(hObject, eventdata, handles)% hObject    handle to listbox2 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    empty - handles not created until after all CreateFcns called% Hint: listbox controls usually have a white background on Windows.%       See ISPC and COMPUTER.if ispc    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end% --- Executes on selection change in listbox2.function listbox2_Callback(hObject, eventdata, handles)% hObject    handle to listbox2 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns listbox2 contents as cell array%        contents{get(hObject,'Value')} returns selected item from listbox2% --- Executes during object creation, after setting all properties.function edit2_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit2 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.%       See ISPC and COMPUTER.if ispc    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction edit2_Callback(hObject, eventdata, handles)% hObject    handle to edit2 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit2 as text%        str2double(get(hObject,'String')) returns contents of edit2 as a double

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -