A bit tedious and Im sure there might be a faster method out there but this solves the problem
T.D1 = 1000 * (2834.1 - 0.29 * T.B - 0.004 * T.B.^(2.0));
T.D1(T.B>=0) = 0;
T.D2 = 1000 * (2501 - 2.36 * T.B);
T.D2(T.B<0) = 0;
T.D = T.D1 + T.D2;
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!