From: Oluwa KuIse on
Hello,
I'm solving problems in overland flow modeling and when fluid depth, h, goes below a set minimum, I want the velocity,U, to be set to zero.
%%
%Given matrices h and U
min_h = 0.001; % arbitrarily set, any number can be put here
[i,j] = find(h < min_h); % (i,j) is the position of elements of h that meet this criterion
U(i,j) = 0; % put zero at the places where h was less than min_h i.e. the i,j.
When I executed this program, all elements of U were replaced with 0 so I'm not getting something right. I will appreciate any help.
Thanks,
Michael
From: dpb on
Oluwa KuIse wrote:
> Hello,
> I'm solving problems in overland flow modeling and when fluid depth, h,
> goes below a set minimum, I want the velocity,U, to be set to zero. %%
> %Given matrices h and U
> min_h = 0.001; % arbitrarily set, any number can be put here
....

> U(i,j) = 0; % put zero at the places where h was less than min_h i.e.
....


U(U<min_h) = 0;

--