blob

by

 

25 Oct 2012 (Updated )

blob

[I1]=gauss31(t,W,O,c,d)
function [I1]=gauss31(t,W,O,c,d)
if nargin==3
    c=1;
    d=0;
end
WX1=-(W(1)-1)/2;
WX2=(W(1)-1)/2;
WY1=-(W(2)-1)/2;
WY2=(W(2)-1)/2;
WZ1=-(W(3)-1)/2;
WZ2=(W(3)-1)/2;
[X, Y,Z] = meshgrid(WX1:WX2, WY1:WY2,WZ1:WZ2);
O(1) = O(1)+WX1;
O(2) = O(2)+WY1;
O(3) = O(3)+WZ1;
I1 = c*exp( -1/2* (t(1,1).*(X-O(1)).^2 + 2 *t(1,2).*(X-O(1)) .*(Y-O(2)) + t(2,2) .*(Y-O(2)).^2 + 2 .*t(1,3) .*(X-O(1)).* (Z-O(3)) + 2 .*t(2,3).* (Y-O(2)).* (Z-O(3)) + t(3,3).* (Z-O(3)).^2)) +d;
end

Contact us