مدرس المادة
Lecture2:
A first steps:
To get matlab to work out 1 + 1, type the following at the prompt:
1+1
matlab responds with
ans = 2
The answer to the typed command is given the name ans. In fact ans is
now a variable that you can use again. For example you can type
ans*ans
to check that 2 × 2=4:
ans*ans
ans = 4
Matlab has updated the value of ans to be 4.
The spacing of operators in formulas does not matter. The following
formulas both give the same answer:
1+3 * 2-1 / 2*4 1+3*2-1/2*4
The order of operations is made clearer to readers of your matlab code if
you type carefully:
1 + 3*2 - (1/2)*4
تحميل الملف