-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplotIm.m
38 lines (35 loc) · 1008 Bytes
/
plotIm.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function plotIm(x,y,logScale,figID)
if nargin < 4; figure; else; figure(figID); end
if nargin < 3; logScale = 0;end
if nargin < 2; y =x; x = 1:length(y);end
if logScale
subplot(211)
plot(x,log(abs(y)+1),'linewidth',2)
hold on
plot(x,angle(y),'linewidth',2)
hold off
legend('log(abs+1)','angle')
xlim([min(x) max(x)])
subplot(212)
plot(x,real(y),'linewidth',2)
hold on
plot(x,imag(y),'linewidth',2)
hold off
legend('real','imag')
xlim([min(x) max(x)])
else
subplot(211)
plot(x,abs(y),'linewidth',2)
hold on
plot(x,angle(y),'linewidth',2)
hold off
legend('Abs','angle')
xlim([min(x) max(x)])
subplot(212)
plot(x,real(y),'linewidth',2)
hold on
plot(x,imag(y),'linewidth',2)
hold off
legend('real','imag')
xlim([min(x) max(x)])
end