diff --git a/src/new/zernike_polynomials/FT_create_synthetic_zernike_map.m b/src/new/zernike_polynomials/FT_create_synthetic_zernike_map.m index 8ab149f13282bc86d3a8e74e61b29934664b4c8a..ec6f8366601801dce6976710f94a3429abce2f92 100644 --- a/src/new/zernike_polynomials/FT_create_synthetic_zernike_map.m +++ b/src/new/zernike_polynomials/FT_create_synthetic_zernike_map.m @@ -55,7 +55,7 @@ function [fake_map] = FT_create_synthetic_zernike_map(zc,option,realsize,gridsiz % The sum of amplitudes in the same order should stay the same but is % randomly distributed over those with different m. for n=0:nmax - A=sum(abs(zc.amp(n+1,1:n+1))) + A=sum(abs(zc.amp(n+1,1:n+1))); i=1; for m=-n:2:n temp_amps(n+1,i)=(2*rand()-1)*A; @@ -64,9 +64,9 @@ function [fake_map] = FT_create_synthetic_zernike_map(zc,option,realsize,gridsiz i=i+1; end - temp_A=sum(abs(temp_amps(n+1,1:I))) - fake_zc.amp(n+1,1:I)=(A/temp_A)*temp_amps(n+1,1:I) - sum(abs(fake_zc.amp(n+1,1:I))) + temp_A=sum(abs(temp_amps(n+1,1:I))); + fake_zc.amp(n+1,1:I)=(A/temp_A)*temp_amps(n+1,1:I); + sum(abs(fake_zc.amp(n+1,1:I))); end end