MATLAB Solve Complex Equations in MATLAB: Q-Functions and SNR | Homework Help

  • Thread starter Thread starter fahim
  • Start date Start date
  • Tags Tags
    Matlab
AI Thread Summary
The discussion centers on writing a specific mathematical equation in MATLAB, focusing on the function Pf = Q(Qinverse(Pd)(1+SNR) + SNR * sqrt(N/2)). The user attempts to implement this in MATLAB using the code Pf = qfunc(qfuncinv(Pd)*(1+SNR)+SNR*(sqrt(N./2))). However, they encounter an error indicating that the argument of the Q function must be a real array. The error suggests that qfuncinv(Pd) is returning a complex number, which may be causing the issue. Participants in the discussion recommend testing the output of qfuncinv(Pd) to identify the source of the problem, while also considering the possibility that the square root function could be involved, assuming N is greater than zero.
fahim
Messages
2
Reaction score
0

Homework Statement



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

Homework Equations



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

where Q is the q function

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)));
 
Physics news on Phys.org
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.
 

Similar threads

Back
Top