Yuxiang Lin
2010-02-17 06:22:05 UTC
I used the following code to plot F. Everything went well until the last line was executed. The warning message 'Warning: Negative data ignored' popped up and the image totally went wrong. I double-checked the values of 'd' and was pretty sure that it was greater than 0.
Would anybody please help me figure this out? Thank you very much!
N = 1000;
t = 3e-9;
d = 0.0001:0.01:1;
w = logspace(-3, 1, 101)/t;
[D, W] = meshgrid(d, w);
S = sqrt((D.*((2*pi./W).^2+4*(pi*t)^2).^2.*(2*pi*D.*...
((2*pi./W).^4+20*((2*pi./W)*pi*t).^2+64*(pi*t)^4)-(2*pi./W).^2.*((2*pi./W).^2+12*(pi*t)^2).*...
sin(2*pi*D))) ./ ...
(16*N*(2*pi./W).^4*pi.*((2*pi./W).^2+16*(pi*t)^2).*sin(pi*D).^2));
F = S*sqrt(N)/t;
figure(1)
imagesc(d, w*t, log10(F));
set(gca, 'yscale', 'log')
Would anybody please help me figure this out? Thank you very much!
N = 1000;
t = 3e-9;
d = 0.0001:0.01:1;
w = logspace(-3, 1, 101)/t;
[D, W] = meshgrid(d, w);
S = sqrt((D.*((2*pi./W).^2+4*(pi*t)^2).^2.*(2*pi*D.*...
((2*pi./W).^4+20*((2*pi./W)*pi*t).^2+64*(pi*t)^4)-(2*pi./W).^2.*((2*pi./W).^2+12*(pi*t)^2).*...
sin(2*pi*D))) ./ ...
(16*N*(2*pi./W).^4*pi.*((2*pi./W).^2+16*(pi*t)^2).*sin(pi*D).^2));
F = S*sqrt(N)/t;
figure(1)
imagesc(d, w*t, log10(F));
set(gca, 'yscale', 'log')