# EEC 281 Matlab Notes

### A few useful functions for 281

.* term-by-term multiply of two vectors
./ term-by-term divide of two vectors
axis set range of axes for plots
conv convolve two sequences
hold for printing multiple plots on an axes
plot x vs. y plots
keyboard Invoke interactive debugging mode from a .m file
.' Transpose row ↔ column without performing a conjugate (use this)
' Transpose with a conjugate (don't use this)
Examples: >> a = [1 + i, 2 + i] % row vector
a =
1.0000 + 1.0000i 2.0000 + 1.0000i
>> a.'
ans =
1.0000 + 1.0000i
2.0000 + 1.0000i
>> a'
ans =
1.0000 - 1.0000i
2.0000 - 1.0000i

### Arrays and matrices with index zero

Matlab does not support an index of zero in arrays (in my opinion, this is the
single greatest drawback/mistake of matlab).

In many cases, indexing down to zero is extremely convenient, such as when
modeling the addressing of a memory.
In these cases, I recommend calculating addresses as normal, and then adding
"+1" whenever reading or writing the memory, for example:

addr = ....;
b = mem(addr+1) * 2;
mem(addr+1) = c + d;

### A few possibly-useful functions for 281

### A few possibly-insightful example 281 apps

EEC 281
| B. Baas
| ECE Dept.
| UC Davis

Written by Bevan Baas

2019/03/06 Written
2019/03/12 Moved functions and apps to this page