## Matlab

Moderators: None (Apply to moderate this forum)
Number of posts: 2174

This Forum Only

Help with logical operations Posted by kapTcaTb on 13 Jan 2013 at 8:36 AM

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 Z<D . I tried several times with 'if,elseif,else' but -NOT-ALL- Y values =0 when Z>D .

Condition
Z<=D
value true - correspond y ; Z<=D
value false - correspond y=0 ; Z>D

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<D for calculation of integral [y](in limits from 0 to D ); Y and Z are taken from table ->
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 .

## Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic