Matlab where function?

Thanks for your help in advance …
Is there a function in matlab that can accomplish what the fortran 90
intrinsic function ‘where’ does:
WHERE ( x >= 0.0 )
z = 4.0*sqrt(x)
ELSEWHERE
z = 0.0
END WHERE
Here x, z are both vectors.
I assume matlab must have something similar, otherwise, looping over every
element of x would be too expensive. Thank you very much~~~

z = zeros(size(x));
ind = find(x>=0);
z(ind) = 4*sqrt(x(ind));

Answer myself:
ind=find(x>=0.);
z=zeros(1,length(x));
z(ind)=4.0*sqrt(x(ind);

其实有更简单的形式:
z=zeros(size(x));
z(x>0)=4.0*sqrt(x(x>0));

而且速度比用find快

一个要做两遍,一个做一遍。

clear
LOOP=100000;
x=-16:.1:16;
S=size(x);
tic;
for i=1:LOOP
z=zeros(S);
z(x>0)=sqrt(x(x>0))*4;
end
toc;
tic;
for i=1:LOOP
z=zeros(S);
ind=find(x>0);
z(ind)=sqrt(x(ind))*4;
end
toc;

timetest
Elapsed time is 4.073553 seconds.
Elapsed time is 4.463364 seconds.

how about ind=x>0;z(ind)=sqrt(x(ind));
and your matrix is too small. overhead too much.

x = randn(5000);
z = zeros(size(x));
tic;z(x>0)=sqrt(x(x>0))*4;toc;
Elapsed time is 3.653124 seconds.
tic;ind=x>0;z(ind)=sqrt(x(ind))*4;toc;
Elapsed time is 3.310924 seconds.