Matlab → Getting started
This chapter begins with basics of Matlab and how it is used for basic calculations. Here we will introduce command window in detail.
Command Window
The first window that appears when we open Matlab is “Command Window”. It is the main window and it is used for simple calculations, and running and showing programs written in other windows; for example scripts and functions. You cannot save your commands or program in the command window to use them in the future.
When you start Matlab, the following screen appears. The window in the middle with sign fx >> is called “Command Window”.
Figure: Command Window, Matlab
Use Matlab as a Calculator
Figure: Basic Commands in Command Window
Type a command and press enter to execute the command. In the first example, we type and press Enter to execute the command. The Matlab shows the answer 5. In the second example, we type and press Enter. The Matlab shows the answer 13. Similarly, the following examples show some more arithmetic problems, Matlab commands, and their answers.
Some basic Arithmetic in the Command Window
Matlab Command
>> 2*(3+4)
Answer: 14
Matlab Command
>> 4.5^2*(1.61+1.72)^2-(13.4-12.3)^-4
Answer: 223.8672
Matlab Command
>> (9+14)/(7-2)
Answer: 4.6000
Matlab Command
>> 6^2+8/4-3
Answer: 35
Matlab Command
>> ((3+2)^2)/(6/2-1)
Answer: 12.5000
Matlab Command
>> 5.5^2*1/5^2+15^2+(1/6-1/7)*11
Answer: 226.4719
Matlab Command
>> (0.25^2*0.35^-3)/(0.04^4+0.5^-5)
Answer: 0.0456
Matlab Command
>> 50*(((1/4+1/3)*2)-((1/5-3/4)*1/2))
Answer: 72.0833