Subscript indices must either be real positive integers or logicals

what should i do to not get this error? >> Subscript indices must either be real positive integers or logicals.

1 commentaire

Make sure that the values of sqrt(EbN0) and sqrt(2*EbN0) always are "real positive integers or logicals"

Connectez-vous pour commenter.

 Réponse acceptée

Remember,
Q(sqrt(EbN0))
means to take the square root of EbN0, and then try to use that square root as an index into the variable Q (which is a scalar.) There is no implied multiplication in MATLAB: if you want
Q .* sqrt(EbN0)
then you have to write that.

2 commentaires

Thank you very much for helping me. I really appreciate your help. I tried running => Q .* sqrt(EbN0) Still i am getting error >> Subscript indices must either be real positive integers or logicals.
It looks like you ran that in the command window, but you did not actually fix line in your script g.m. You need to edit the script before you run it.
Also, you will need to fix the next line
Q .* sqrt(2*EbN0)

Connectez-vous pour commenter.

Plus de réponses (2)

the cyclist
the cyclist le 8 Août 2017
It looks like you have somehow created a variable with the name sqrt, and you are inadvertently accessing that variable, rather than the sqrt function.

3 commentaires

No, not in this particular case -- but that does certainly happen sometimes!
Ah, you are right. I missed the evidence that the workspace didn't have an sqrt variable.
MOHINI MODI
MOHINI MODI le 8 Août 2017
Modifié(e) : MOHINI MODI le 8 Août 2017
Hello Sir, Thank you very much for helping me. sqrt is matlab function i am using and Q is input signal, which is '1'

Connectez-vous pour commenter.

Catégories

En savoir plus sur Graphics Performance dans Centre d'aide et File Exchange

Produits

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by