Showing posts with label MATLAB PROGRAMS. Show all posts
Showing posts with label MATLAB PROGRAMS. Show all posts

Wednesday, November 17, 2010

0

MATLAB Program to Add 2 Numbers.

  • Wednesday, November 17, 2010
  • tech
  • Lets Write a simple program to add two Programs
    As i had already discussed you can either execute program in the Command Window or save a program as .m file.
    1) Executing a program in a Command Window

    Just select the Command Window and write the necesary codes as shown below


    The figure shows how to add 2 numbers.
    Here i have used two variables x and y
    just write in the command window x='any value say 2' and y='say2'
    then write x+y and press enter.
    You wil get Result 4 in the command window as shown above
    Simple Huh!
    But for larger programs it is neccessary to save the program.


    Program to add two numbers using text editor

    Select Text Editor by using the Following Step


    Select file menu


    >select New


    >select .m file


    >type the program name and save the file and type the program code


    NOTE:We can write comments between the codes using the % symbol.just type % and write the codes


    Here Goes the Program


    clc; %clear command window
    x=input(' x='); %accept tha value of x
    y=input(' y='); %accept tha value of y
    z=x+y;
    disp('z='); %display function inbuilt in matlab to display a string
    disp(z); %display the value of z




    Read more...
    0

    Introduction to MATLAB

  • tech
  • MATLAB(MATrixLABoratory) is a high speed software designed to solve complex engineering problems within a second! It covers all sections of Electronics such as SignalProcessing,Control System,Image Processing,Communication and lot more! It has separate toolboxes for performing this functions.It has many inbuilt functions to perform the complex calculations.In short,MATLAB makes Engineering Computing Easier!
    Read more...