Answers to Exercise 1:
1: t = 0:pi/100:2*pi; plot(sin(t), cos(t)); hold on plot(sin(t)*0.5, cos(t)*0.5); plot(sin(t)*0.25, cos(t)*0.25); |
|
2: plot (sin(t) - 0.25, cos(t) - 0.25) hold on plot (sin(t) + 0.25, cos(t) - 0.25) plot (sin(t) + 0.25, cos(t) + 0.25) plot (sin(t) - 0.25, cos(t) + 0.25) axis square |
|
3: a = rand(4,4) sum(a) %sum of columns sum(a')' %sum of rows sum(sum(a)) % total sum |
|
4: plot(2 + sin(t) * 2, 2 + cos(t)); hold on plot(2 + sin(t), 2 + cos(t) * 2); axis square |