### MatLab Beginner Interview Questions | Matlab Skill check for Beginners

### What is the order of arithmetical operations in MatLab coding?

- Exponential function
**^** - Negation
**-** - Multiplication
***** - Division
**/** - Divides Into
**\** - Addition +
- Subtraction
**-** - Parentheses
**( )**

### What are all the Logical Operators in Matlab?

- OR represented by
**||** - AND represented by
**&&** - NOT represented by
**~**

### What is the difference between 'Divides' and 'Divides Into' in Matlab?

Divide represented by / , Divides into represented by \Example for 5/10 = 0.5, where 5 is divided by 10 which would result in 0.5

Example for 5\10 = 2, where 10 divides in to

**2**fives

### When should I use Single =, double = in Matlab?

- Single = to assign a value to a variable. ex: x=5 , assigns the value of x as 5
- Double = to check whether the value of variable and returns the logical answer Yes (1) or No(0). ex: x==4, returns the result logical 0, since we have assigned x = 5 just before.

### How to define ranges of values?

- As a basic type, you can use : to create a set of numbers inside the range assigned for a variable.
- For example, x=4:10 , will result in assigning the values to the variable x = {4,5,6,7,8,9,10}
- One step ahead, x=4:2:10 will assign the values in increment of 2 between 4 and 10. (i.e.) , x={4,6,8,10}

**What is the inbuilt function to round up a decimal number?**

- ceil(12.3) = 13
- floor(12.3)= 12
- round(12.5) =13

### How to convert degrees to Radians in matlab?

- Use the function deg2rad(170)
- You will get the results as ans

### How to generate random number in Matlab?

- Command
*rand*generates random number . - Type
*rand =* - To set the seed number that acts as a base of the random number, then you have to use the command,
*rng(xx)*where xx is your seed number. - The random number will be a decimal four digit number, ex:0.5546. If you want a real random number, then you have to multiply this random number in to a value and store it in a new variable

<< Home