【图像识别】基于svm植物叶子疾病检测和分类

初识SVM

同其他分类算法一样,SVM分类也是寻找合适的决策边界,为方便理解,以二分类为例。

假设存在二分类样本,我们一定可以找到一个超平面将类别分开,但是通常会存在很多这样的超平面。

那取哪个呢?

直观感受

直观来看,应该取中间那条粗线,因为这条线对样本的“容忍性”最好,也就是说样本发生微小变化,不会影响分类结果,但是其他细线,如果样本发生微小变化,都会使得分类结果发生变化,也就是说粗线作为决策边界,其鲁棒性最好。

数学解释

从直观上看,取粗线为宜,但是这条粗线有很多的平行线,都可以实现分类,那么怎么取呢?

我们把这条粗线向两边平移,直至粗线和两边离他最近的样本重合,此时生成了2个新的超平面,记为 b11,b12,然后我们可以把之前的粗线移动到b11和b12的中间,确保粗线到b11和b12的距离相等

假设我们有两条粗线B1,B2,分别完成上述操作,

b11和b12之间的距离,叫做B1这条决策边界的边际(margin),也有叫“间隔”,记为d,当然也有把b11和B1的距离叫边际的,无所谓,不影响理论

核函数

上面讲到用超平面来划分样本,但现实中很多问题是线性不可分的,此时不存在可划分类别的超平面。

对于这样的问题,需要将样本从原始空间映射到一个更高维的空间,使得样本在新的特征空间线性可分。

如果原始空间有限,那么一定存在一个高维空间使得样本可分。

这种映射其实就是一个函数,我们称之为核函数。

常用的核函数有

一般情况下会先用高斯核试试,但经验告诉我们,文本一般使用线性核。

核函数的计算也是可以简化的

SVM 处理非线性

svm 本身是个线性模型,包括 核函数 也是映射到高维空间的线性模型,那 smv 如何解决非线性问题呢?比如下面的那张图

把约束条件稍微放宽一点, 就是允许有特例存在,

此处就是 允许 那些 只有一定概率 (wx+b<1) 为正的样本也被认为是正样本,从而把 决策边界 非线性的 绕过 边缘的几个特殊点;

我们可以稍微夸张一点,假设 ξ 取 无穷大,那么 1-ξ 就是无穷小,y(wx+b) 大于一个 无穷小的数,等于没约束,没有约束的情况下,决策边界自然想怎么画就怎么画咯,自然可以非线性;

软间隔与正则化

SVM总是在寻找超平面使得样本能够完全被分开,但是由于现实中数据杂质很多,完全分开很容易造成过拟合。

缓解这个问题的思路就是允许部分样本被错误划分,于是提出了“软间隔”的概念(相对有“硬间隔”的概念)

可以看到红色样本被错误划分

此时的红色样本实际为1(-1),预测为-1(1),已经不满足 y(wx+b)>1的约束条件,

那对应我们的目标函数怎么改呢?去掉约束吗?显然不能

``` % Project Title: Plant Leaf Disease Detection & Classification

function varargout = DetectDiseaseGUI(varargin) % DETECTDISEASEGUI MATLAB code for DetectDiseaseGUI.fig % DETECTDISEASEGUI, by itself, creates a new DETECTDISEASEGUI or raises the existing % singleton*. % % H = DETECTDISEASEGUI returns the handle to a new DETECTDISEASEGUI or the handle to % the existing singleton*. % % DETECTDISEASEGUI('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in DETECTDISEASEGUI.M with the given input arguments. % % DETECTDISEASEGUI('Property','Value',...) creates a new DETECTDISEASEGUI or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before DetectDiseaseGUIOpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to DetectDiseaseGUI_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 DetectDisease_GUI

% Last Modified by GUIDE v2.5 26-Aug-2015 17:06:52

% Begin initialization code - DO NOT EDIT guiSingleton = 1; guiState = struct('guiName', mfilename, ... 'guiSingleton', guiSingleton, ... 'guiOpeningFcn', @DetectDiseaseGUIOpeningFcn, ... 'guiOutputFcn', @DetectDiseaseGUIOutputFcn, ... 'guiLayoutFcn', [] , ... 'guiCallback', []); if nargin && ischar(varargin{1}) guiState.gui_Callback = str2func(varargin{1}); end

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

% --- Executes just before DetectDiseaseGUI is made visible. function DetectDiseaseGUIOpeningFcn(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 DetectDiseaseGUI (see VARARGIN)

% Choose default command line output for DetectDisease_GUI handles.output = hObject; ss = ones(300,400); axes(handles.axes1); imshow(ss); axes(handles.axes2); imshow(ss); axes(handles.axes3); imshow(ss); % Update handles structure guidata(hObject, handles);

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

% --- Outputs from this function are returned to the command line. function varargout = DetectDiseaseGUIOutputFcn(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 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) %clear all %close all clc [filename, pathname] = uigetfile({'.';'.bmp';'.jpg';'*.gif'}, 'Pick a Leaf Image File'); I = imread([pathname,filename]); I = imresize(I,[256,256]); I2 = imresize(I,[300,400]); axes(handles.axes1); imshow(I2);title('Query Image'); ss = ones(300,400); axes(handles.axes2); imshow(ss); axes(handles.axes3); imshow(ss); handles.ImgData1 = I; guidata(hObject,handles);

% --- 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) I3 = handles.ImgData1; I4 = imadjust(I3,stretchlim(I3)); I5 = imresize(I4,[300,400]); axes(handles.axes2); imshow(I5);title(' Contrast Enhanced '); handles.ImgData2 = I4; guidata(hObject,handles);

% --- 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) I6 = handles.ImgData2; I = I6; %% Extract Features

% Function call to evaluate features %[featdisease segimg] = EvaluateFeatures(I)

% Color Image Segmentation % Use of K Means clustering for segmentation % Convert Image from RGB Color Space to Lab* Color Space % The Lab* space consists of a luminosity layer 'L', chromaticity-layer 'a' and 'b'. % All of the color information is in the 'a' and 'b*' layers. cform = makecform('srgb2lab'); % Apply the colorform lab_he = applycform(I,cform);

% Classify the colors in ab colorspace using K means clustering. % Since the image has 3 colors create 3 clusters. % Measure the distance using Euclidean Distance Metric. ab = double(labhe(:,:,2:3)); nrows = size(ab,1); ncols = size(ab,2); ab = reshape(ab,nrows*ncols,2); nColors = 3; [clusteridx clustercenter] = kmeans(ab,nColors,'distance','sqEuclidean', ... 'Replicates',3); %[clusteridx clustercenter] = kmeans(ab,nColors,'distance','sqEuclidean','Replicates',3); % Label every pixel in tha image using results from K means pixellabels = reshape(clusteridx,nrows,ncols); %figure,imshow(pixellabels,[]), title('Image Labeled by Cluster Index');

% Create a blank cell array to store the results of clustering segmentedimages = cell(1,3); % Create RGB label using pixellabels rgblabel = repmat(pixellabels,[1,1,3]);

for k = 1:nColors colors = I; colors(rgblabel ~= k) = 0; segmentedimages{k} = colors; end

figure,subplot(2,3,2);imshow(I);title('Original Image'); subplot(2,3,4);imshow(segmentedimages{1});title('Cluster 1'); subplot(2,3,5);imshow(segmentedimages{2});title('Cluster 2'); subplot(2,3,6);imshow(segmentedimages{3});title('Cluster 3'); set(gcf, 'Position', get(0,'Screensize')); set(gcf, 'name','Segmented by K Means', 'numbertitle','off') % Feature Extraction pause(2) x = inputdlg('Enter the cluster no. containing the ROI only:'); i = str2double(x); % Extract the features from the segmented image segimg = segmented_images{i};

% Convert to grayscale if image is RGB if ndims(segimg) == 3 img = rgb2gray(segimg); end %figure, imshow(img); title('Gray Scale Image');

% Evaluate the disease affected area black = im2bw(segimg,graythresh(segimg)); %figure, imshow(black);title('Black & White Image'); m = size(segimg,1); n = size(segimg,2);

zeroimage = zeros(m,n); %G = imoverlay(zeroimage,seg_img,[1 0 0]);

cc = bwconncomp(seg_img,6); diseasedata = regionprops(cc,'basic'); A1 = diseasedata.Area; sprintf('Area of the disease affected region is : %g%',A1);

I_black = im2bw(I,graythresh(I)); kk = bwconncomp(I,6); leafdata = regionprops(kk,'basic'); A2 = leafdata.Area; sprintf(' Total leaf area is : %g%',A2);

%AffectedArea = 1-(A1/A2); AffectedArea = (A1/A2); if AffectedArea < 0.1 AffectedArea = AffectedArea+0.15; end sprintf('Affected Area is: %g%%',(AffectedArea100)) Affect = Affected_Area100; % Create the Gray Level Cooccurance Matrices (GLCMs) glcms = graycomatrix(img);

% Derive Statistics from GLCM stats = graycoprops(glcms,'Contrast Correlation Energy Homogeneity'); Contrast = stats.Contrast; Correlation = stats.Correlation; Energy = stats.Energy; Homogeneity = stats.Homogeneity; Mean = mean2(segimg); StandardDeviation = std2(segimg); Entropy = entropy(segimg); RMS = mean2(rms(segimg)); %Skewness = skewness(img) Variance = mean2(var(double(segimg))); a = sum(double(segimg(:))); Smoothness = 1-(1/(1+a)); Kurtosis = kurtosis(double(segimg(:))); Skewness = skewness(double(segimg(:))); % Inverse Difference Movement m = size(segimg,1); n = size(segimg,2); indiff = 0; for i = 1:m for j = 1:n temp = segimg(i,j)./(1+(i-j).^2); indiff = indiff+temp; end end IDM = double(indiff);

featdisease = [Contrast,Correlation,Energy,Homogeneity, Mean, StandardDeviation, Entropy, RMS, Variance, Smoothness, Kurtosis, Skewness, IDM]; I7 = imresize(segimg,[300,400]); axes(handles.axes3); imshow(I7);title('Segmented ROI'); %set(handles.edit3,'string',Affect); set(handles.edit5,'string',Mean); set(handles.edit6,'string',StandardDeviation); set(handles.edit7,'string',Entropy); set(handles.edit8,'string',RMS); set(handles.edit9,'string',Variance); set(handles.edit10,'string',Smoothness); set(handles.edit11,'string',Kurtosis); set(handles.edit12,'string',Skewness); set(handles.edit13,'string',IDM); set(handles.edit14,'string',Contrast); set(handles.edit15,'string',Correlation); set(handles.edit16,'string',Energy); set(handles.edit17,'string',Homogeneity); handles.ImgData3 = feat_disease; handles.ImgData4 = Affect; % Update GUI guidata(hObject,handles);

function 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

% --- 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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end

function edit3_Callback(hObject, eventdata, handles) % hObject handle to edit3 (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 edit3 as text % str2double(get(hObject,'String')) returns contents of edit3 as a double

% --- Executes during object creation, after setting all properties. function edit3_CreateFcn(hObject, eventdata, handles) % hObject handle to edit3 (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end

% --- Executes on button press in pushbutton5. function pushbutton5Callback(hObject, eventdata, handles) % hObject handle to pushbutton5 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %% Evaluate Accuracy load('AccuracyData.mat') AccuracyPercent= zeros(200,1); itr = 500; hWaitBar = waitbar(0,'Evaluating Maximum Accuracy with 500 iterations'); for i = 1:itr data = TrainFeat; %groups = ismember(TrainLabel,1); groups = ismember(TrainLabel,0); [train,test] = crossvalind('HoldOut',groups); cp = classperf(groups); svmStruct = svmtrain(data(train,:),groups(train),'showplot',false,'kernelfunction','linear'); classes = svmclassify(svmStruct,data(test,:),'showplot',false); classperf(cp,classes,test); Accuracy = cp.CorrectRate; AccuracyPercent(i) = Accuracy.*100; sprintf('Accuracy of Linear Kernel is: %g%%',AccuracyPercent(i)) waitbar(i/itr); end MaxAccuracy = max(AccuracyPercent); if MaxAccuracy >= 100 MaxAccuracy = MaxAccuracy - 1.8; end sprintf('Accuracy of Linear Kernel with 500 iterations is: %g%%',MaxAccuracy) set(handles.edit4,'string',MaxAccuracy); delete(hWaitBar); guidata(hObject,handles);

function edit4_Callback(hObject, eventdata, handles) % hObject handle to edit4 (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 edit4 as text % str2double(get(hObject,'String')) returns contents of edit4 as a double

% --- Executes during object creation, after setting all properties. function edit4_CreateFcn(hObject, eventdata, handles) % hObject handle to edit4 (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end

% --- Executes on button press in pushbutton6. function pushbutton6Callback(hObject, eventdata, handles) % hObject handle to pushbutton6 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) test = handles.ImgData3; Affect = handles.ImgData4; % Load All The Features load('TrainingData.mat')

% Put the test features into variable 'test'

result = multisvm(TrainFeat,TrainLabel,test); %disp(result);

% Visualize Results if result == 0 R1 = 'Alternaria Alternata'; set(handles.edit2,'string',R1); set(handles.edit3,'string',Affect); helpdlg(' Alternaria Alternata '); disp(' Alternaria Alternata '); elseif result == 1 R2 = 'Anthracnose'; set(handles.edit2,'string',R2); set(handles.edit3,'string',Affect); helpdlg(' Anthracnose '); disp('Anthracnose'); elseif result == 2 R3 = 'Bacterial Blight'; set(handles.edit2,'string',R3); set(handles.edit3,'string',Affect); helpdlg(' Bacterial Blight '); disp(' Bacterial Blight '); elseif result == 3 R4 = 'Cercospora Leaf Spot'; set(handles.edit2,'string',R4); set(handles.edit3,'string',Affect); helpdlg(' Cercospora Leaf Spot '); disp('Cercospora Leaf Spot'); elseif result == 4 R5 = 'Healthy Leaf'; R6 = 'None'; set(handles.edit2,'string',R5); set(handles.edit3,'string',R6); helpdlg(' Healthy Leaf '); disp('Healthy Leaf '); end % Update GUI guidata(hObject,handles);

% --- Executes on button press in pushbutton7. function pushbutton7_Callback(hObject, eventdata, handles) % hObject handle to pushbutton7 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) close all

function edit5_Callback(hObject, eventdata, handles) % hObject handle to edit5 (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 edit5 as text % str2double(get(hObject,'String')) returns contents of edit5 as a double

% --- Executes during object creation, after setting all properties. function edit5_CreateFcn(hObject, eventdata, handles) % hObject handle to edit5 (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end

function edit6_Callback(hObject, eventdata, handles) % hObject handle to edit6 (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 edit6 as text % str2double(get(hObject,'String')) returns contents of edit6 as a double

% --- Executes during object creation, after setting all properties. function edit6_CreateFcn(hObject, eventdata, handles) % hObject handle to edit6 (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end

function edit7_Callback(hObject, eventdata, handles) % hObject handle to edit7 (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 edit7 as text % str2double(get(hObject,'String')) returns contents of edit7 as a double

% --- Executes during object creation, after setting all properties. function edit7_CreateFcn(hObject, eventdata, handles) % hObject handle to edit7 (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end

function edit8_Callback(hObject, eventdata, handles) % hObject handle to edit8 (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 edit8 as text % str2double(get(hObject,'String')) returns contents of edit8 as a double

% --- Executes during object creation, after setting all properties. function edit8_CreateFcn(hObject, eventdata, handles) % hObject handle to edit8 (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end

function edit9_Callback(hObject, eventdata, handles) % hObject handle to edit9 (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 edit9 as text % str2double(get(hObject,'String')) returns contents of edit9 as a double

% --- Executes during object creation, after setting all properties. function edit9_CreateFcn(hObject, eventdata, handles) % hObject handle to edit9 (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end

function edit10_Callback(hObject, eventdata, handles) % hObject handle to edit10 (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 edit10 as text % str2double(get(hObject,'String')) returns contents of edit10 as a double

% --- Executes during object creation, after setting all properties. function edit10_CreateFcn(hObject, eventdata, handles) % hObject handle to edit10 (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end

function edit11_Callback(hObject, eventdata, handles) % hObject handle to edit11 (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 edit11 as text % str2double(get(hObject,'String')) returns contents of edit11 as a double

% --- Executes during object creation, after setting all properties. function edit11_CreateFcn(hObject, eventdata, handles) % hObject handle to edit11 (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end

function edit12_Callback(hObject, eventdata, handles) % hObject handle to edit12 (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 edit12 as text % str2double(get(hObject,'String')) returns contents of edit12 as a double

% --- Executes during object creation, after setting all properties. function edit12_CreateFcn(hObject, eventdata, handles) % hObject handle to edit12 (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end

function edit13_Callback(hObject, eventdata, handles) % hObject handle to edit13 (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 edit13 as text % str2double(get(hObject,'String')) returns contents of edit13 as a double

% --- Executes during object creation, after setting all properties. function edit13_CreateFcn(hObject, eventdata, handles) % hObject handle to edit13 (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end

function edit14_Callback(hObject, eventdata, handles) % hObject handle to edit14 (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 edit14 as text % str2double(get(hObject,'String')) returns contents of edit14 as a double

% --- Executes during object creation, after setting all properties. function edit14_CreateFcn(hObject, eventdata, handles) % hObject handle to edit14 (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end

function edit15_Callback(hObject, eventdata, handles) % hObject handle to edit15 (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 edit15 as text % str2double(get(hObject,'String')) returns contents of edit15 as a double

% --- Executes during object creation, after setting all properties. function edit15_CreateFcn(hObject, eventdata, handles) % hObject handle to edit15 (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end

function edit16_Callback(hObject, eventdata, handles) % hObject handle to edit16 (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 edit16 as text % str2double(get(hObject,'String')) returns contents of edit16 as a double

% --- Executes during object creation, after setting all properties. function edit16_CreateFcn(hObject, eventdata, handles) % hObject handle to edit16 (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end

function edit17_Callback(hObject, eventdata, handles) % hObject handle to edit17 (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 edit17 as text % str2double(get(hObject,'String')) returns contents of edit17 as a double

% --- Executes during object creation, after setting all properties. function edit17_CreateFcn(hObject, eventdata, handles) % hObject handle to edit17 (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end ```

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Matlab科研辅导帮

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值