Exercise1 Matlab For Your Easy Understand
Exercise1 Matlab For Your Easy Understand
There are two main methods of learning any new programming language. One is, to understand the in-
depth idea and process behind every single concept. The other is to learn through solving problems. This
exercise is the part of second method. I always ask people to solve problems at the very beginning stage.
This will keep the learning interesting as you will see the results instantly. Hope you guys will enjoy these
exercise. HAPPY LEARNING.
1. There are three main windows when you open matlab viz. command window, command history
and current folder. So the question is, where you will type your code to perform an addition of
two variables?
2. What happens when you drag and drop a variable from command history to command window?
3. Define a variable a and set its value 1.
4. What is the size of the matrix you created above in question number 3? HINT: Use command
size (variable).
5. Define another matrix b with value 3.
6. Create a new matrix C by adding matrix a and matrix b.
7. Evaluate the following expressions:
1. 2^8.
2. 22/7-
3. -e^
8. Evaluate the following expressions, omitting semicolons at the ends of your lines. You
should have the format short (the default) in eect for all but the last two items.
(a) 1/0
(b) 0/0
(c) 1 10^-8
(d) 1 10^-20
(e) 1 10^-8 with format long in eect
(f) 1 10^-20 with format long in eect