1 BANSILAL RAMNATH AGARWAL CHARITABLE TRUST’S VISHWAKARMA INSTITUTE OF TECHNOLOGY PUNE – 411 037. (An Autonomous Institute Affiliated to University of Pune) A Mini project report on “MATLAB GUI ” (CALCULATOR, PLOTS, RESPONSES, CONVOLUTION) Submitted by RISHYAB KOUL (R-10) SHRIJAY KALAMBE (Q-27) SANDEEP SURYAWANSHI (R-16) Under The Guidance of Prof. Mrs. S.S. PATANKAR Dept. of Instrumentation and control.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
BANSILAL RAMNATH AGARWAL CHARITABLE TRUST’S
VISHWAKARMA INSTITUTE OF TECHNOLOGY
PUNE – 411 037.
(An Autonomous Institute Affiliated to University of Pune)
A Mini project report on
“MATLAB GUI ”
(CALCULATOR, PLOTS, RESPONSES, CONVOLUTION)
Submitted by
RISHYAB KOUL (R-10)
SHRIJAY KALAMBE (Q-27)
SANDEEP SURYAWANSHI (R-16)
Under The Guidance of
Prof. Mrs. S.S. PATANKAR
Dept. of Instrumentation and control.
2
Bansilal Ramnath Agrawal Charitable Trust’s
VISHWAKARMA INSTITUTE OF TECHNOLOGY
PUNE – 411 037.
CERTIFICATE
This is to certify that the mini project titled “MATLAB GUI” has been completed in the
academic year 2012-13 by RISHYAB KOUL (R-10), SHRIJAY KALAMBE (Q-27) and
SANDEEP SURYAWANSHI (R-16) in partial fulfillment of the Bachelor’s Degree in the
second Year Instrumentation Engineering as prescribed by the University of Pune.
Prof. Mrs. S S Patankar Prof. Dr. J V Kulkarni
(Guide) (Head of the Department)
Place: Pune Date:
3
ACKNOWLEDGEMENT
We would like to thank our project guide Prof. Mrs. S.S.Patankar for her valuable
guidance, suggestions and timely help in the completion of project report on
“MATLAB GUI. We would also like to extend our sincere gratitude to Prof. Dr. J.V.
KULKARNI Head of Department and all the staff members of the Instrumentation and
Control Engineering Department for their timely support, encouragement and
guidance. Last but not the least we express profuse regards and deep wishes to friends
who gave helping hands with their direct and indirect co-operation.
4
Table of Contents
Chapter Sr. No. Topic Page
No.
1 Introduction 7
1.1 Motivation 7
1.2 Scope 7
1.3 Problem statement 7
2 Calculator 8
2.1 Function used 8
2.2 Flow chart 9
2.3 Pseudo code 10
2.4 Testing 10
3 Plot 11
3.1 Function used 11
3.2 Flow chart 12
3.3 Pseudo code 13
3.4 Testing 13
4 Responses 14
4.1 Function used 14
4.2 Flow chart 15
4.3 Pseudo code 16
4.4 Testing 16
5 Convolution 17
5
5.1 Function used 18
5.2 Flow chart 19
5.3 Pseudo code 20
5.4 Testing 20
6 Step 21
6.1 Function used 21
6.2 Flow chart 22
6.3 Pseudo code 23
6.4 Testing 23
7 bode 24
7.1 Function used 24
7.2 Flow chart 25
7.3 Pseudo code 26
7.4 Testing 26
8 Conclusion/Future scope 27
9 Bibliography 28
6
List of Figures
Sr. No. Topic Page no.
1 Fig 2.1 Calculator 8
2 fig 3.1 Sine curve 11
3 Fig 4.1: Convolution sum of the two systems. 14
4 Fig 5.2 impulse response of system 17
5 Fig 6.1step response of system 20
6 Fig7. 1 bode plot of system
23
7
Chapter 1.
Introduction
Here by using basic tools of MATLAB GUI (graphical user interface ) we have made
calculator , plots of basic function ,bode plots ,impulse response ,step response ,convolution of
system .for understanding the basic function of the GUI and programming we have made the
calculator which will perform the basic function mathematics like addition, multiplication,
subtraction , division and some more .which helped lots us to understand tools in in matlab and
programming . Here by understanding concepts of GUI we have applied to find out bode plot of
any system to graphically means without going for programming and which will easy for
anybody to find bode plot of system.
For convolution we had plotted two given function and range we have taken from user.
The we have added that this two function by using graphical method. Mainmenu is a
combination of all function through which we can go to all for operation.
1.1 Motivation: We have studied the ‘Signals and system’ and Control System then we came across many terms
like bode plot, impulse response, step response, convolution of two signals. We have
implemented this all in the very wonderful matrix laboratory tool “MATLAB”, and then we
thought of making it very user friendly so that without knowing the programming for the
particular function one can use it.
For that we used the Matlab GUI tool to make it user friendly in this way we come up with this
project.
1.2 Scope: By using this matlab GUI tool the mathematical concept like impulse response, step response,
bode plot, convolution can be made very user friendly without knowing these above concepts
how to implement in matlab one can use this tool. No need to do programming again and again it
will save lots of time of user to get output.
1.3 Problem statement:
To develop an algorithm for calculator, plots, responses, convolution using matlab
programming and graphical user interface .make the GUI in such a way that user can give input
and he will get the output in the graphical or algebraic form
8
Chapter 2.
Fig 1.1 Calculator:
2.1 Function used
1. strcat
2. str2num
3. get
4. set
9
2.2 Flow chart:
INPUT OF NUMBER &
OPERATION
THROUGH GUI
CHECK IF
THE
NUMBER
IS PRESNT
IN TEXT
BOX STRING =STRING
THROGH THE INPUT
+STRING FROM TEXT BOX
START
CONVERT STRING INTO
NUMBER
RESULT
STOP
10
2.3 Algorithm: 1. For this we have first made GUI ,added this push button to which will serve as an input
for taking the number through user and arithmetical input such as ( + ,- , *, /, )
2. We have added static text box for displaying input which is given by user and for
showing the result.
3. Here we have used the logic as taking input from user as string it will take as string
from the user through button and it will add this string to string which if already present
in the static text box .
4. PSUDO CODE FOR THIS IS AS FOLLOW
n=get(handles.text1,'String');
m=get(handles.pushbutton17,'String');
set(handles.text1,'string',strcat(n,m))
% Here we adding two string through function strcat
When we press the equal to (=) button the this string which is present
in static text bar will be converted into the number by using