summaryrefslogtreecommitdiff
path: root/useful_functions.m
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2009-12-16 05:12:22 +0000
committerEugeniy Mikhailov <evgmik@gmail.com>2009-12-16 05:12:22 +0000
commit32648d980195e97da34668b49ce721f67463084e (patch)
treee629dfcd3664d3c5d502fa9d2e1d0ea1c527fe9d /useful_functions.m
parenta72559eddad189a78d80e20db0a12592e0e18014 (diff)
downloadmulti_mode_eit-32648d980195e97da34668b49ce721f67463084e.tar.gz
multi_mode_eit-32648d980195e97da34668b49ce721f67463084e.zip
vectorization in rhoOfFreq
Diffstat (limited to 'useful_functions.m')
-rw-r--r--useful_functions.m7
1 files changed, 2 insertions, 5 deletions
diff --git a/useful_functions.m b/useful_functions.m
index b7156cf..10afb69 100644
--- a/useful_functions.m
+++ b/useful_functions.m
@@ -18,11 +18,8 @@ function rho=rhoOfFreq(rhoLiouville, freqIndex, Nlevels)
% this function create from Liouville density vector
% the density matrix with given modulation frequency
rho=zeros(Nlevels);
- for r=1:Nlevels
- for c=1:Nlevels
- rho(r,c)=rhoLiouville((freqIndex-1)*Nlevels^2+(r-1)*Nlevels+c);
- endfor
- endfor
+ rho(:)=rhoLiouville((freqIndex-1)*Nlevels^2+1:(freqIndex)*Nlevels^2);
+ rho=rho.';
endfunction
function [N, rhoLiouville_w, rhoLiouville_r, rhoLiouville_c]=unfold_density_matrix(Nlevels,Nfreq)