summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2012-01-11 13:18:12 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2012-01-11 13:21:15 -0500
commit3507456719560ea6729d3490d61a56bfb52a9b45 (patch)
tree843acca662865c940038c0cc0023b2e22875bfd4
parent1e74ab5dd863c6bb8fc63ed1ed3fbf437071139c (diff)
downloadNresonances-3507456719560ea6729d3490d61a56bfb52a9b45.tar.gz
Nresonances-3507456719560ea6729d3490d61a56bfb52a9b45.zip
map2dat.m fix of wrong indexing
-rw-r--r--xmds2/Nlevels_with_doppler_with_z_4wm/fast_to_slow_switch/map2dat.m10
1 files changed, 5 insertions, 5 deletions
diff --git a/xmds2/Nlevels_with_doppler_with_z_4wm/fast_to_slow_switch/map2dat.m b/xmds2/Nlevels_with_doppler_with_z_4wm/fast_to_slow_switch/map2dat.m
index 969b6dc..4f4ca52 100644
--- a/xmds2/Nlevels_with_doppler_with_z_4wm/fast_to_slow_switch/map2dat.m
+++ b/xmds2/Nlevels_with_doppler_with_z_4wm/fast_to_slow_switch/map2dat.m
@@ -9,17 +9,17 @@ function map2dat(outfile, x,y,z, xskip, yskip)
Nx=length(x);
Ny=length(y);
-Nxs=Nx/xskip;
-Nys=Ny/yskip;
+Nxs=ceil(Nx/xskip);
+Nys=ceil(Ny/yskip);
points=zeros(1,3*Nxs*Nys);
%points=[];
tic;
for i=1:Nxs
for k=1:Nys
%points=[points x(i*xskip) y(k*yskip) z(k*yskip,i*xskip)];
- points((i-1)*(Nys-1)*3+3*(k-1)+1) = x(i*xskip);
- points((i-1)*(Nys-1)*3+3*(k-1)+2) = y(k*yskip);
- points((i-1)*(Nys-1)*3+3*(k-1)+3) = z(k*yskip,i*xskip);
+ points((i-1)*(Nys)*3+3*(k-1)+1) = x(1+(i-1)*xskip);
+ points((i-1)*(Nys)*3+3*(k-1)+2) = y(1+(k-1)*yskip);
+ points((i-1)*(Nys)*3+3*(k-1)+3) = z(1+(k-1)*yskip,1+(i-1)*xskip);
end
end
disp('=== points formation complete ===');