Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Write equation in matlab

  1. Jul 2, 2008 #1
    1. The problem statement, all variables and given/known data

    hi... how can i write this equation in matlab

    2. Relevant equations

    Pf = Q(Qinverse(Pd)(1+SNR) + SNR * square root(N/2))

    where Q is the q function

    3. The attempt at a solution
    I tried the equation with the following

    Pf = qfunc(qfuncinv(Pd)*(1+SNR)+SNR*(sqrt(N./2)));
    But it is showing the folowing error
    ??? Error using ==> qfunc at 19
    The argument of the Q function must be a real array.

    Error in ==> part1 at 5
    Pf = qfunc(qfuncinv(Pd)*(1+SNR)+SNR*(sqrt(N./2)));
  2. jcsd
  3. Jul 11, 2008 #2
    Apparently you are getting a complex number from the qfuncinv. You can test this by just looking at what qfuncinv(Pd) yields. I guess it could also be the sqrt, but I'm assuming N > 0.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook