3. MATLAB Variables

>> D = 2
D =
     2
>> v = 3
v =    
     3

To recall the variable use arrow keys up ↑ and down ↓ for scrolling through previous commands.

>> D
D =
     2
>> 
>> rho = 1000;
>> mu = 0.001;
>> Re = D*v*rho/mu
Re =
     6000000
>>

MATLAB does not require any type declarations or dimension statements. MATLAB is case sensitive; it distinguishes between uppercase and lowercase letters. The variables "A" and "a" are not the same variable. Variable name can contain up to 63 characters. Variable names start with a letter, followed by letters, numbers or underscores. (e.g.: NRe_2_the_power2by3)

Tags: