I need to emulate this VBA code in Matlab:
If M > 1 Then PR_NS = (kp * M ^ 2 / (km * M ^ 2 + 2)) ^ e1 _ * (kp / (2 * k * M ^ 2 - km)) ^ e2Else PR_NS = 1End If
Where M is a column vector of arbitrary (unknown) size and other items (kp, km, e1, e2) are scalers.
The intent is to return a column vector PR_NS of the same size as M. Depending on each value of M, each value of PR_NS may either be 1 or the value resulting from the equation.
I know this is a very basic question, but I am a newbie and have an urgent need to implement this. Thanks!
Best Answer