Vit Brain Finger

Embed Size (px)

Citation preview

Branch Counselors Message

It gives me immense pleasure to see the April Issue of IEEE Student Branch Newsletter, Swasti being released. I would like to inform the students and faculty members that the Technical Symposium, Zeta 05 organized by IEEE Student Branch, VIT, in association with Association of Electrical Engineers, got covered in the IEEE Madras Section Newsletter (Issue March). The IEEE Student Branch, VIT also got appreciation from the IEEE Madras Section, in the Madras Section Newsletter (Issue March) for its release of the IEEE Student Branch, VIT website www.vit.ac.in/ieee and online newsletter, Swasti. I look forward to more students and faculty members becoming IEEE Member in the coming future. Please send your feedback/suggestions to [email protected] .

R. Saravana Kumar Branch Counselor IEEE Student Branch Vellore Institute of Technology

Chairmans Message

It is heartening to see the April Issue of IEEE Student Branch, VIT Newsletter, SWASTI being released on 16th April 05. Swasti gives an opportunity to students and faculty of Vellore Institute of Technology (Deemed University) to pen down their technical knowledge as Technical Articles, Technical Abstracts and Technical Quizzes, thus giving them a chance to share their knowledge with other students and faculty all over the world. Swasti, being an online newsletter, is easily accessible to anyone, anywhere in the world. The best technical article chosen from each issue of Swasti, will be forwarded to be published in the Madras Section Newsletter, Mas-Link, which covers the IEEE Student Branch of colleges all over Tamil Nadu. I would like to mention that the number of members of IEEE Student Branch, VIT have nearly tripled in the past six months. As of now, 61 people are a part of this Esteemed Technical Society. I look forward to more students and faculty joining IEEE to become a part of the Esteemed IEEE FRATERNITY Please send your feedback/suggestions to [email protected] .

Aditya Zutshi III ECE Chairman & Editor IEEE Student Branch Vellore Institute of Technology

From Editors Desk

Welcome to the April Issue of IEEE Student Branch, VIT Newsletter, Swasti. We would like to thank the students and faculty members for appreciating the efforts made by IEEE Student Branch, VIT in bringing out the first online newsletter, Swasti and for giving a positive feedback for the same. It is heartening to see Students and Faculty Members coming forward for submitting their Technical Articles for the Newsletter. We hope of having more students and faculty members contributing Technical Articles/Technical Paper Abstracts/Technical Projects Abstract/Technical Quizzes for the newsletter in the coming future. Please mail your contributions for the forthcoming issues to [email protected] / [email protected] . Let The Saga Of IEEE Continue Editors: Aditya Zutshi III ECE Kashyap Reddy I CSE

Latest News The Executive Committee of the IEEE Student Branch, VIT for the Session 2005-2006 was Nominated. The new committee took effect from 1st April 2005.The committee is as follows : Branch Counselor Mr. R. Saravana Kumar Senior Lecturer, EEE Department Chairman Mr. Aditya Zutshi III ECE Vice Chairman Mr. Rahul Pratyush Mohanty II EIE Secretary Mr. Anupam Singh II CSE Treasurer Miss. Aditi Sharma II IT Web Administrator Mr. Kashyap Reddy I CSE Public Relations Officer Mr. Abhinav Bisen I EIE Editors Mr. Aditya Zutshi III ECE Mr. Kashyap Reddy I CSE

Technical Article 1 Introduction To Matlab

MATLAB, developed by Math Works Inc., is a software package for high performance numerical computation and visualization. MATLAB provides an interactive environment with hundreds of reliable and accurate built-in mathematical functions. These functions provide solutions to a broad range of mathematical problems including matrix algebra, complex arithmetic, linear systems, differential equations, signal processing, optimization, nonlinear systems, and many other types of scientific computations. The most important feature of MATLAB is its programming capability, which is very easy to learn and to use, and which allows userdeveloped functions. It also allows access to FORTRAN algorithms and C codes by means of external interfaces. There are several optional toolboxes written for special applications such as signal processing, control systems design, system identification, statistics, neural networks, fuzzy logic, symbolic computations, and others. MATLAB supports almost every computational platform. MATLAB for WINDOWS is started by clicking on the MATLAB icon. The Command window is launched, and after some messages such as intro, demo, help help, info, and others, the prompt >> is displayed. The program is in an interactive command mode. Typing who or whos displays a list of variable names currently in memory. Also, the dir command lists all the files on the default directory. MATLAB has an on-line help facility, and its use is highly recommended. The command help provides a list of files, built-in functions and operators for which on-line help is available. The Command help function name will give information on the specified

function as to its purpose and use. The command help will give information as to how to use the on-line help. MATLAB has a demonstration program that shows many of its features. The Command demo brings up a menu of the available demonstrations... A program can be written and saved in ASCII format with a filename having extension .m in the directory where MATLAB runs. To run the program, click on the Command window and type the filename without the .m extension at the MATLAB command. You can view the text Edit window simultaneously with the Command window. Basic Array Operations a = [ 1 2; 3 4 ]; a(1,:) % Gets first row a(:,1) % Gets first column a(1,1) % Gets first element 2*a a * a % Matrix multiplication in the math sense a .* a % Element-by-element Matrix multiplication >> ... , % ; : prompt continue statement on next line separate statements & data start comment which ends at end of line

suppress output and used also as row separator in matrix specify range

Plotting with MATLAB MATLAB will plot one vector vs. another. The first one will be treated as the abscissa (or x) vector and the second as the ordinate (or y) vector. The vectors have to be the same length. MATLAB will also plot a vector vs. its own index. The index will be treated as the abscissa vector. There are commands in MATLAB to "annotate" a plot to put on axis labels, titles, and legends. For example: >> % To put a label on the axes: >> xlabel ('X-axis label') >> ylabel ('Y-axis label') >> % To put a title on the plot: >> title ('Title of my plot') Vectors may be extracted from matrices. Normally, we wish to plot one column vs. another. If we have a matrix mydata with two columns, we can obtain the columns as a vectors with the assignments as follows: >> first_vector = mydata ( : , 1) ; >> % and we can plot the data: % First column

>> second_vector = mydata ( : , 2) ; % Second one >> plot ( first_vector , second_vector )

Matlab Programs Programs in Matlab are: Scripts, or Functions Scripts: Matlab statements that are fed from a file into the Command Window and executed immediately Functions: Program modules that are passed data (arguments) and return a result (i.e., sin(x)) These are created in any text editor (but Matlab supplies a nice built-in editor) Getting Data into a Script There are three basic ways to get data into a script: Create variables in Co mmand window before running your script and then use them in your script directly Use the INPUT() function to let the user enter data from a prompt Open a file and read data into variables Matlab Function Format function fout = mfilename( arg list ) Statements Function output must be set equal to fout. mfilename is the name of the mfile where function is saved.

R.Saravana Kumar Senior Lecturer EEE Department Vellore Institute of Technology

Technical Article 2 ATM Software Working Principle & Programming Code In Visual Basic Principle: We have already used ATM machines till now. The working of the ATM machine really amuses us, especially the software in it. It has the capability of checking our pins, analyzing the transactions and finally delivering the money and the receipt with the balance amount and the withdrawing amount. Before we see into the programming code, let us see the general algorithm of how ATM software works. Algorithm: STEP 1: Open the introductory screen on the machine if the magnetic drive is detected and matched from the card holder STEP 2: Prompt user to enter the pin. STEP 3: If the user enters a wrong pin, notify him the same and ask him to enter the correct pin again. If the pin is entered wrongly three times, end the program and block the transactions STEP 4: If the user enters the correct pin in less than three attempts, take him to a fresh screen. STEP 5: In the fresh screen, show the balance amount, and ask the user to enter the amount he wants to withdraw. STEP 6: Process the transactions if and only if the user enters the amount less than $2000 and see to that the withdrawing amount is less than the balance amount. STEP 7: If the withdrawing amount is greater than the balance, notify the same and end the program.

STEP 8: As long as user enters the valid amount process the transactions. STEP 9: If the user presses exit button, stop the program. The Visual Basic Codes For more details, run ATM.exe or open Project1.vbp Under form1 In the design mode, form 1 consists of a text box with name text1 and two buttons,command1 and command 2. Dim shyam As Integer Private Sub command1_click() If Text1.Text = 1111 Then Form1.Hide Form2.Show Else MsgBox "wrong pin.try again" shyam = shyam + 1 If shyam = 3 Then MsgBox "YOU HAVE PRESSED THE WRONG PIN THREE TIMES.SORRY YOUR TRANSACTIONS ARE BLOCKED!" End End If End If End Sub Private Sub Command2_Click() MsgBox "THANK YOU VISIT AGAIN" End End Sub Under form 2 in the design mode,form 2 consists of 4 text boxes,text1,text2,text3,text4,and two command buttons, command1 and command 2

Dim total As Integer Dim draw As Integer Dim remain As Integer Public Sub command1_click() If Text2.Text 2000 Then MsgBox "AMOUNT SHOULD BE LESS THAN $2000" End If End Sub Private Sub Command2_Click() End End Sub for more details, run ATM.exe or open Project1.vbp There is a more user friendly version in C. ATM programming C is useful because most of the hacking softwares cannot find the key sequence typed. In VB, the user is highly venerable. So the code in C is given below

C Code for the software (built in Turbo C compiler): //hey the ultimate ATM program is here #include #include void main() { char shyam[6],choice,yn; int i,count=0,wdraw; int balance=30000; dam: clrscr(); printf("============================================ ===================================="); printf("\nATM Process emulator.....the working process behind the ATM software IEEE @ VIT"); printf("\n=========================================== ====================================="); printf("enter pin:-(pin for this trail version is 321123):-"); for(i=0;ibalance) { printf("\nhow can you have more money than in your balance"); getch(); goto shyam; } if(wdraw1000) { printf("\nsorry as per guidelines..... per transaction restrictions prevent you from doing this"); getch(); goto shyam; } if(wdraw>=100 && wdraw