Вы находитесь на странице: 1из 14

Serial Communication,

for quire contact: engnr.shakeel@gamil.com

MATLAB GUI DATABASE via MS


EXCEL for STORAGE and
EXPORTING DATA REAL TIME
UPGRADATION
SOFTWARE: MATLAB 2009 USED

BEST OF LUCK.
Engr Rana Muhammad Shakeel
Engnr.shakeel@gmail.com
+92-333-4962507
https://www.facebook.com/EngnrShakeel

FOR MY MORE SHORT PROJECTS:


https://uettaxila.academia.edu/EngrRanaMShakeel

plz like my page:


https://www.facebook.com/Electrical4Electronics

Engr Rana M Shakeel, +92-333-4962507 | engnr.shakeel@gmail.com

Serial Communication,

for quire contact: engnr.shakeel@gamil.com

GUI Diagram

Engr Rana M Shakeel, +92-333-4962507 | engnr.shakeel@gmail.com

Serial Communication,

for quire contact: engnr.shakeel@gamil.com

Code:
function varargout = UserGUI(varargin)
% USERGUI M-file for UserGUI.fig
%
USERGUI, by itself, creates a new USERGUI or raises the existing
%
singleton*.
%
%
H = USERGUI returns the handle to a new USERGUI or the handle to
%
the existing singleton*.
%
%
USERGUI('CALLBACK',hObject,eventData,handles,...) calls the local
%
function named CALLBACK in USERGUI.M with the given input arguments.

Engr Rana M Shakeel, +92-333-4962507 | engnr.shakeel@gmail.com

Serial Communication,

for quire contact: engnr.shakeel@gamil.com

%
%
USERGUI('Property','Value',...) creates a new USERGUI or raises the
%
existing singleton*. Starting from the left, property value pairs are
%
applied to the GUI before UserGUI_OpeningFcn gets called. An
%
unrecognized property name or invalid value makes property application
%
stop. All inputs are passed to UserGUI_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 UserGUI
% Last Modified by GUIDE v2.5 30-Nov-2013 18:44:25
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',
mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @UserGUI_OpeningFcn, ...
'gui_OutputFcn', @UserGUI_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback',
[]);
if nargin && ischar(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 UserGUI is made visible.


function UserGUI_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 UserGUI (see VARARGIN)
% Choose default command line output for UserGUI
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes UserGUI wait for user response (see UIRESUME)
% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.

Engr Rana M Shakeel, +92-333-4962507 | engnr.shakeel@gmail.com

Serial Communication,

for quire contact: engnr.shakeel@gamil.com

function varargout = UserGUI_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;

% --- If Enable == 'on', executes on mouse press in 5 pixel border.


% --- Otherwise, executes on mouse press in 5 pixel border or over text1.
function text1_ButtonDownFcn(hObject, eventdata, handles)
% hObject
handle to text1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)

% --- Executes on button press in Search_pushbutton1.


function Search_pushbutton1_Callback(hObject, eventdata, handles)
% hObject
handle to Search_pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
Rfid=str2num(get(handles.RFID_edit1,'string'));
[RFID,NAMES,VEHICAL,ENGINE,CHASIS,MOBILE,BALANCE,TOLL1,TOLL2]=Dataa();
Totalids=lengthh(); %display the total number of RFID's in Datatbase
search=Rfid;
i=0;
x=0;
y=0;
for i=2:(Totalids+1)
temp=cell2mat(RFID(i)); %convert cell to data numaeric
if( temp==search)
x=i; % telling the index of RFID in MS EXCEL
y=1;
end
end
if(y==0)
set(handles.Name_edit2,'string',' ');
set(handles.Vehical_edit3,'string',' ');
set(handles.Engine_edit4,'string',' ');
set(handles.Chasis_edit5,'string',' ');
set(handles.Mobile_edit6,'string',' ');
set(handles.Balance_edit7,'string',' ');
set(handles.Toll1_edit8,'string',' ');
set(handles.Toll2_edit9,'string',' ');
set(handles.error_flag,'string','NO record Found');
y=1;
end
if(x>0)
set(handles.error_flag,'string','
Rfid=RFID(x);
Name=NAMES(x);

');

%display RFID of the "x" ID


%display NAME of the "x" RFID

Engr Rana M Shakeel, +92-333-4962507 | engnr.shakeel@gmail.com

Serial Communication,

for quire contact: engnr.shakeel@gamil.com

set(handles.Name_edit2,'string',Name);
Vehical=VEHICAL(x);
%display VEHICAL no of
set(handles.Vehical_edit3,'string',Vehical);
Engine=ENGINE(x);
%display engine no of
set(handles.Engine_edit4,'string',Engine);
Chasis=CHASIS(x);
%display chasis no of
set(handles.Chasis_edit5,'string',Chasis);

the "x" RFID

the "x" RFID


the "x" RFID

int32 y;
Mobile=MOBILE(x);
%display mobile of the "x" RFID
y=cell2mat(Mobile);
%convert cell to data numaeric
m=mat2str(y);
%convert datae numaeric to string
set(handles.Mobile_edit6,'string',m);
Balance=BALANCE(x);
%display balance of the "x" RFID
y=cell2mat(Balance);
%convert cell to data numaeric
m=mat2str(y) ;
%convert datae numaeric to string
set(handles.Balance_edit7,'string',m);
Toll1=TOLL1(x);
%display TOLL1 of the "x" RFID
y=cell2mat(Toll1);
%convert cell to data numaeric
m=mat2str(y) ;
%convert datae numaeric to string
set(handles.Toll1_edit8,'string',m);
Toll2=TOLL2(x);
%display TOLL2 of the "x" RFID
y=cell2mat(Toll2);
%convert cell to data numaeric
m=mat2str(y);
%convert datae numaeric to string
set(handles.Toll2_edit9,'string',m);
end

% --- Executes on button press in ADD_pushbutton2.


function ADD_pushbutton2_Callback(hObject, eventdata, handles)
% hObject
handle to ADD_pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
[RFID,NAMES,VEHICAL,ENGINE,CHASIS,MOBILE,BALANCE,TOLL1,TOLL2]=Dataa();
[ndata, text, alldata] = xlsread('test.xlsx');
Totalids=lengthh(); %display the total number of RFID's in Datatbase
no=Totalids+2;
alldata{no,9}=[] ; %adding new cell array in MS EXCEL

ans=0;
a = (get(handles.RFID_edit1,'string'));
id=str2num(a); %converting strinf to number
for i=1:no;

Engr Rana M Shakeel, +92-333-4962507 | engnr.shakeel@gmail.com

Serial Communication,

for quire contact: engnr.shakeel@gamil.com

temp1=cell2mat(RFID(i)); %convert cell to data numaeric


if( temp1==id)
set(handles.error_flag,'string','RFID already EXIST...!'); %NEW RFID is
STORED in Database
ans=1;
end
end
if( ans==0)
RFID(no)=mat2cell(id); %convert numeric data
alldata(:,1)=RFID(); %adding updated aarraay

to cell

name = (get(handles.Name_edit2,'string'));
NAMES(no)=cellstr(name); %convert str data in to aarray
alldata(:,2)=NAMES(); %adding updated aarraay
veh = (get(handles.Vehical_edit3,'string'));
VEHICAL(no)=cellstr(veh); %convert str data in to aarray
alldata(:,3)=VEHICAL(); %adding updated aarraay
eng =(get(handles.Engine_edit4,'string'));
ENGINE(no)=cellstr(eng); %convert str data in to aarray
alldata(:,4)=ENGINE(); %adding updated aarraay

chas = (get(handles.Chasis_edit5,'string'));
CHASIS(no)=cellstr(chas); %convert str data in to aarray
alldata(:,5)=CHASIS(); %adding updated aarraay

mob = (get(handles.Mobile_edit6,'string'));
MOBILE(no)=mat2cell(mob); %convert numeric data
alldata(:,6)=MOBILE(); %adding updated aarraay

to cell

blc = (get(handles.Balance_edit7,'string'));
BALANCE(no)=mat2cell(blc); %convert numeric data
alldata(:,7)=BALANCE(); %adding updated aarraay

t1 = (get(handles.Toll1_edit8,'string'));
TOLL1(no)=mat2cell(t1); %convert numeric data
alldata(:,8)=TOLL1(); %adding updated aarraay

to cell

to cell

t2 = (get(handles.Toll2_edit9,'string'));
TOLL2(no)=mat2cell(t2); %convert numeric data to cell
alldata(:,9)=TOLL2(); %adding updated aarraay
xlswrite('test.xlsx',alldata) %updating the MS EXCEL file
set(handles.error_flag,'string','Database Updated'); %NEW RFID is STORED
in Database
end

Engr Rana M Shakeel, +92-333-4962507 | engnr.shakeel@gmail.com

Serial Communication,

for quire contact: engnr.shakeel@gamil.com

function RFID_edit1_Callback(hObject, eventdata, handles)


% hObject
handle to RFID_edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
Rfid=str2num(get(handles.RFID_edit1,'string'));
% Hints: get(hObject,'String') returns contents of RFID_edit1 as text
%
str2double(get(hObject,'String')) returns contents of RFID_edit1 as a
double

% --- Executes during object creation, after setting all properties.


function RFID_edit1_CreateFcn(hObject, eventdata, handles)
% hObject
handle to RFID_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 && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function Name_edit2_Callback(hObject, eventdata, handles)


% hObject
handle to Name_edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
Name=(get(handles.Name_edit2,'string'));
% Hints: get(hObject,'String') returns contents of Name_edit2 as text
%
str2double(get(hObject,'String')) returns contents of Name_edit2 as a
double

% --- Executes during object creation, after setting all properties.


function Name_edit2_CreateFcn(hObject, eventdata, handles)
% hObject
handle to Name_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 Engine_edit4_Callback(hObject, eventdata, handles)


% hObject
handle to Engine_edit4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)

Engr Rana M Shakeel, +92-333-4962507 | engnr.shakeel@gmail.com

Serial Communication,

for quire contact: engnr.shakeel@gamil.com

Engine=(get(handles.Engine_edit4,'string'));
% Hints: get(hObject,'String') returns contents of Engine_edit4 as text
%
str2double(get(hObject,'String')) returns contents of Engine_edit4 as
a double

% --- Executes during object creation, after setting all properties.


function Engine_edit4_CreateFcn(hObject, eventdata, handles)
% hObject
handle to Engine_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

function Vehical_edit3_Callback(hObject, eventdata, handles)


% hObject
handle to Vehical_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 Vehical_edit3 as text
%
str2double(get(hObject,'String')) returns contents of Vehical_edit3
as a double

% --- Executes during object creation, after setting all properties.


function Vehical_edit3_CreateFcn(hObject, eventdata, handles)
% hObject
handle to Vehical_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

function Mobile_edit6_Callback(hObject, eventdata, handles)


% hObject
handle to Mobile_edit6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
Mobile=str2num(get(handles.Mobile_edit6,'string'));
% Hints: get(hObject,'String') returns contents of Mobile_edit6 as text
%
str2double(get(hObject,'String')) returns contents of Mobile_edit6 as
a double

Engr Rana M Shakeel, +92-333-4962507 | engnr.shakeel@gmail.com

Serial Communication,

for quire contact: engnr.shakeel@gamil.com

% --- Executes during object creation, after setting all properties.


function Mobile_edit6_CreateFcn(hObject, eventdata, handles)
% hObject
handle to Mobile_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 Chasis_edit5_Callback(hObject, eventdata, handles)


% hObject
handle to Chasis_edit5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
Chasis=(get(handles.Chasis_edit5,'string'));
% Hints: get(hObject,'String') returns contents of Chasis_edit5 as text
%
str2double(get(hObject,'String')) returns contents of Chasis_edit5 as
a double

% --- Executes during object creation, after setting all properties.


function Chasis_edit5_CreateFcn(hObject, eventdata, handles)
% hObject
handle to Chasis_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 Balance_edit7_Callback(hObject, eventdata, handles)


% hObject
handle to Balance_edit7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
Balance=str2num(get(handles.Balance_edit7,'string'));
% Hints: get(hObject,'String') returns contents of Balance_edit7 as text
%
str2double(get(hObject,'String')) returns contents of Balance_edit7
as a double

% --- Executes during object creation, after setting all properties.


function Balance_edit7_CreateFcn(hObject, eventdata, handles)
% hObject
handle to Balance_edit7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB

10

Engr Rana M Shakeel, +92-333-4962507 | engnr.shakeel@gmail.com

Serial Communication,
% handles

for quire contact: engnr.shakeel@gamil.com

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 Toll1_edit8_Callback(hObject, eventdata, handles)


% hObject
handle to Toll1_edit8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
Toll1=str2num(get(handles.Toll1_edit8,'string'));
% Hints: get(hObject,'String') returns contents of Toll1_edit8 as text
%
str2double(get(hObject,'String')) returns contents of Toll1_edit8 as
a double

% --- Executes during object creation, after setting all properties.


function Toll1_edit8_CreateFcn(hObject, eventdata, handles)
% hObject
handle to Toll1_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 Toll2_edit9_Callback(hObject, eventdata, handles)


% hObject
handle to Toll2_edit9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
Toll2=str2num(get(handles.Toll2_edit9,'string'));
% Hints: get(hObject,'String') returns contents of Toll2_edit9 as text
%
str2double(get(hObject,'String')) returns contents of Toll2_edit9 as
a double

% --- Executes during object creation, after setting all properties.


function Toll2_edit9_CreateFcn(hObject, eventdata, handles)
% hObject
handle to Toll2_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.

11

Engr Rana M Shakeel, +92-333-4962507 | engnr.shakeel@gmail.com

Serial Communication,

for quire contact: engnr.shakeel@gamil.com

if ispc && isequal(get(hObject,'BackgroundColor'),


get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

% --- Executes on button press in MSEXCEL_pushbutton4.


function MSEXCEL_pushbutton4_Callback(hObject, eventdata, handles)
% hObject
handle to MSEXCEL_pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
[RFID,NAMES,VEHICAL,ENGINE,CHASIS,MOBILE,BALANCE,TOLL1,TOLL2]=Dataa();
[ndata, text, alldata] = xlsread('test.xlsx');
xlswrite('C:\Users\shakeel\Desktop\RFIF DATABASE.xlsx',alldata) %updating the
MS EXCEL file
set(handles.error_flag,'string','Database Exported to DESKTOP in MS Excel
Format'); %NEW RFID is STORED in Database
% --- Executes on button press in Clear_pushbutton5.
function Clear_pushbutton5_Callback(hObject, eventdata, handles)
% hObject
handle to Clear_pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
set(handles.RFID_edit1,'string',' ');
set(handles.Name_edit2,'string',' ');
set(handles.Vehical_edit3,'string',' ');
set(handles.Engine_edit4,'string',' ');
set(handles.Chasis_edit5,'string',' ');
set(handles.Mobile_edit6,'string',' ');
set(handles.Balance_edit7,'string',' ');
set(handles.Toll1_edit8,'string',' ');
set(handles.Toll2_edit9,'string',' ');
set(handles.error_flag,'string',' ');

% --- Executes on button press in Save_pushbutton7.


function Save_pushbutton7_Callback(hObject, eventdata, handles)
% hObject
handle to Save_pushbutton7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
Rfid=str2num(get(handles.RFID_edit1,'string'));
[RFID,NAMES,VEHICAL,ENGINE,CHASIS,MOBILE,BALANCE,TOLL1,TOLL2]=Dataa();
Totalids=lengthh(); %display the total number of RFID's in Datatbase
search=Rfid;
i=0;
x=0;
for i=2:(Totalids+1)
temp=cell2mat(RFID(i)); %convert cell to data numaeric
if( temp==search)
x=i; % telling the index of RFID in MS EXCEL
end
end
no=x;
id =(get(handles.RFID_edit1,'string'));

12

Engr Rana M Shakeel, +92-333-4962507 | engnr.shakeel@gmail.com

Serial Communication,

for quire contact: engnr.shakeel@gamil.com

a = (get(handles.RFID_edit1,'string'));
id=str2num(a); %converting strinf to number
RFID(no)=mat2cell(id); %convert numeric data
alldata(:,1)=RFID(); %adding updated aarraay

to cell

name = (get(handles.Name_edit2,'string'));
NAMES(no)=cellstr(name); %convert str data in to aarray
alldata(:,2)=NAMES(); %adding updated aarraay
veh = (get(handles.Vehical_edit3,'string'));
VEHICAL(no)=cellstr(veh); %convert str data in to aarray
alldata(:,3)=VEHICAL(); %adding updated aarraay
eng =(get(handles.Engine_edit4,'string'));
ENGINE(no)=cellstr(eng); %convert str data in to aarray
alldata(:,4)=ENGINE(); %adding updated aarraay

chas = (get(handles.Chasis_edit5,'string'));
CHASIS(no)=cellstr(chas); %convert str data in to aarray
alldata(:,5)=CHASIS(); %adding updated aarraay

mob = (get(handles.Mobile_edit6,'string'));
MOBILE(no)=mat2cell(mob); %convert numeric data
alldata(:,6)=MOBILE(); %adding updated aarraay

to cell

blc = (get(handles.Balance_edit7,'string'));
BALANCE(no)=mat2cell(blc); %convert numeric data
alldata(:,7)=BALANCE(); %adding updated aarraay

t1 = (get(handles.Toll1_edit8,'string'));
TOLL1(no)=mat2cell(t1); %convert numeric data
alldata(:,8)=TOLL1(); %adding updated aarraay

to cell

to cell

t2 = (get(handles.Toll2_edit9,'string'));
TOLL2(no)=mat2cell(t2); %convert numeric data to cell
alldata(:,9)=TOLL2(); %adding updated aarraay
xlswrite('test.xlsx',alldata) %updating the MS EXCEL file
set(handles.error_flag,'string','Database Updated'); %NEW RFID is STORED
in Databas

% --- Executes on button press in Activate_radiobutton1.


function Activate_radiobutton1_Callback(hObject, eventdata, handles)
% hObject
handle to Activate_radiobutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of Activate_radiobutton1

13

Engr Rana M Shakeel, +92-333-4962507 | engnr.shakeel@gmail.com

Serial Communication,

for quire contact: engnr.shakeel@gamil.com

function Code_edit13_Callback(hObject, eventdata, handles)


% hObject
handle to Code_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 Code_edit13 as text
%
str2double(get(hObject,'String')) returns contents of Code_edit13 as
a double

% --- Executes during object creation, after setting all properties.


function Code_edit13_CreateFcn(hObject, eventdata, handles)
% hObject
handle to Code_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

FUNCTION1: Dataa()
function [RFID,NAMES,VEHICAL,ENGINE,CHASIS,MOBILE,BALANCE,TOLL1,TOLL2]=Dataa()

[ndata, text, alldata] = xlsread('test.xlsx');


RFID=alldata(:,1); %getting aLL RFIDS from the MS EXCEL
NAMES=alldata(:,2); %getting aLL names from the MS EXCEL
VEHICAL=alldata(:,3); %getting aLL vehical no from the MS EXCEL
ENGINE=alldata(:,4); %getting aLL engine from the MS EXCEL
CHASIS=alldata(:,5); %getting aLL chasis from the MS EXCEL
MOBILE=alldata(:,6); %getting aLL mobile from the MS EXCEL
BALANCE=alldata(:,7); %getting aLL balance from the MS EXCEL
TOLL1=alldata(:,8); %getting aLL toll1 from the MS EXCEL
TOLL2=alldata(:,9); %getting aLL toll2 from the MS EXCEL
end

14

Engr Rana M Shakeel, +92-333-4962507 | engnr.shakeel@gmail.com

Вам также может понравиться