Arithmetic Logic Unit (ALU) in a computer’s CPU executes fundamental arithmetic and logical operations. These are combined at higher levels of hardware and software to perform more sophisticated computations.
Knowing this can improve engineers’ understanding and performance in several areas:
MATLAB statements are instructions; they are not equations.
= is an assignment operator.== is a comparison operator used in logical expressions.| Variable Type | Memory Size | Examples |
|---|---|---|
| Double | 8 Bytes | 5, 1.2345, pi, -7.3e5, … |
| Character | 2 Bytes | 'x', 'y', '0', … |
| Logical | 1 Byte | false, true |
| P | Q | P & Q | P | Q |
|---|---|---|---|
| T | T | T | T |
| T | F | F | T |
| F | T | F | T |
| F | F | F | F |
| P | Q | R | Q | R | P & (Q | R) |
|---|---|---|---|---|
| T | T | T | T | T |
| T | T | F | T | T |
| T | F | T | T | T |
| T | F | F | F | F |
| F | T | T | T | F |
| F | T | F | T | F |
| F | F | T | T | F |
| F | F | F | F | F |
For more details and examples on propositional logic, please visit: Propositional Logic
User-defined function examples: