- We can assign values to variables. Matlab understands their data types automatically.
- Comments start with % sign.
Type a = 1 to assign a value to a and press “Enter/Return” key. Now, MATLAB interprets it as an integer.
>> a=1 % integer (Comments start with % sign) a = 1
Another integer variable:
>> b=2 % integer b = 2
Float Variable – Assign a decimal point to a variable (say, c) as shown below. Matlab interprets c as a float.
>> c=42.365 %float
>> d = ‘a’ % character
>> s='school of engg‘ %string