Some Great Thoughts

"Go ahead and do your best" | "It is the simple things in life that build brilliance in creativity..simplicity cannot be taught, it is inborn..do not tamper with it" | "All men dream but not equally. Those who dream by night in the dusty recesses of their minds wake in the day to find that it was vanity; but the dreamers of the day are dangerous men, for they may act their dream with open eyes to make it possible" | "इच्छा हमेशा योग्यता को हरा देती है" | "If you think you can do a thing or think you can't do a thing, you're right. -Henry Ford" | "Failure is success if we learn from it. -Malcolm S. Forbes" | "The future belongs to those who believe in the beauty of their dreams. -Eleanor Roosevelt" | "The great men and women of history are remembered, not because they never made mistakes or never failed, but because they didn't let their failures stop them. They kept on until they succeeded" | "असफलता हमें सिखाती है कि सफलता का प्रयत्न पूरे मन से नहीं किया गया"

Sunday, September 11, 2011

Programming in MATLAB for Beginners-1

Programming in MATLAB is simpler then any other programming language.
Here you can see the MATLAB window which contain "Directory, Command Window, Workspace & Command History".
We use Command Window to write any program or commands. Command windo also show output of any program or any instuction.
We can check our variables in Workspace & we also get our previous commands in Command History.
Here is some Basic Programs for beginners like Addition or other mathematical operations.

 Program of Addition of Two or More Numbers:-

>> %input first number
>> a=5;
>> %input second number
>> b=9;
>> %addition
>> c=a+b

c =

    14
Or



>> %input first number
>> a=5;
>> %input second number
>> b=9;
>> %addition
>> c=a+b;
>> %type c and press enter
>> c

c =

    14

Or

>> %input first number
>> a=5;
>> %input second number
>> b=9;
>> %addition
>> c=a+b;
>> %to display result use 'disp'
>>disp(c)
    14

Similarly we can perform subtraction of two numbers.


No comments:

Post a Comment