# Help with logical operations

Hello everyone !
First of all i want to say im new to Matlab ( also my english sux ) .

I have 3 arrays -

z=[z(1) .... z(35)]
y=[y(1) .... y(35)]
D=9.38 for example ; D is calculated early

i need to calculate y for each ZD .

Condition
[b]Z<=D
value true - correspond y ; Z<=D
value false - correspond y=0 ; Z>D[/b]

There are values for Z and Y
Z=[0.00 0.05 0.10 0.25 0.50 0.75 1.00 1.25 1.50 1.75 2.00 2.50 3.00 3.50 4.00 4.50 5.00 5.50 6.00 6.50 7.00 7.50 8.00 8.50 9.00 9.50 10.00 10.50 11.00 11.50 12.00 12.50 13.00 13.50 14.00];
total 35 values

Y=[0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.848 2.277 3.483 4.449 5.241 5.909 6.487 6.998 7.454 7.864 8.232 8.559 8.847 9.095 9.306 0.000];
total 35 values

I need values of Y for any Z
http://picbg.net/img.php?file=c81299efd0a86aff.jpg

Any help would be useful to me , also if you have example for similar IF calculations pls give me advices .

#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!