MATLAB Commands
Linear Algebra
Loops
Boolean
Mystery
100

What does the command 'clc' do?

Clears the command window


100

Is it possible to multiply a 2x3 by a 4x3

What is no?


100

For what condition would you choose to use a while-loop rather than a for-loop?

When looping is needed but the number of passes is not known in advance.

100

This symbol ⊕ 

What is the exclusive or (XOR) symbol?

100

This is used in MATLAB when you've written code that makes no sense but you’re too afraid to delete it.

What is % comment it out and pretend it never happened?

200

Give dimensions of an array A using MATLAB

What is size(A)?


200

How would you compute sin(x/2)*x^2 for every element in matrix x

What is sin(x/2).*x.^2

200

How many times will a for loop iterate?

What is as many times in the conditional statement?


200

You overslept. Let:

  • A = "I set an alarm"

  • B = "I actually woke up"

The Boolean expression is:
A AND B

If A = 1 (true), but B = 0 (false), what’s the result of A AND B?

What is 0 — because setting an alarm means nothing if you still sleep through it! 😴⏰

200

What is the difference between disp and fprintf?

What is:
disp is used to quickly display text or variable values without formatting, while fprintf allows formatted output, including control over spacing, decimal places, and inserting variables into strings.

300

If you have 6 graphs in one window arranged in a 2x3 configuration. How would you edit the bottom middle one.

What is subplot(2,2,5)?

300

What is the augmented matrix if :

A = [2  3  -1;

    -4  1   5;

     1 -2   3];


d = [5; -2; 4];

What is [A d]?

300

sum = 0;

for i = 1:5

    sum = sum + i;

end

What is 15?

300

What is the truth table for a NOT XOR

Drawn on board

300

What type of Arduino sensor is used to measure distance?

ultrasonic sensor

400

What is diag(4:-1:1)?

4 0 0 0

0 3 0 0

0 0 2 0

0 0 0 1

400

What is the MATLAB command to solve a system of equations when A is the coefficient matrix and d is the constant vector? 


what is rref([A d])?

400

How many times will this while loop iterate?

x = 0

y = 0

while x < 10

if y == 0

x = x+1

end

y = 1

end

What is infinite?

400

This symbol:

What is NOR symbol?


400

What is the voltage on a button pin when a button is NOT pressed?

5 V

500

The MATLAB command to read to from an excel file titled info 

what is xlsread("info.xlsx")

500

What is the dimensions of the resulting matrix from multiplying 1x3 by a 7x3?

What is trick question it's not possible?
500

Blink an LED on pin D5 for 3 dashes. Each blink lasts 0.6 seconds, with 0.2 second pauses between blinks.

for x = 1:3

    MyArduino.writeDigitalPin('D5', 1)

    pause(0.6)

    MyArduino.writeDigitalPin('D5', 0)

    pause(0.2)

end

500

Truth table for the following:

!((A⋅B)+!(C⋅D))

On Board


500

True or False, an Arduino is an example of a Microprocessor. 

FALSE