Array indices must be positive integers or logical values.

e = exp(-SNR_index.^2./2)
compute_the_Q = integral(@(SNR_index) (1/sqrt(2*pi)).*e, SNR_index,Inf,'ArrayValued',true);
exact_P_e_AWGN(SNR_index) = log10(compute_the_Q(sqrt(2*SNR_per_bit_linear(SNR_index)))) ;
Error: Array indices must be positive integers or logical values.

Réponses (1)

e = exp(-SNR_index.^2./2)
SNR_index is undefined.
compute_the_Q = integral(@(SNR_index) (1/sqrt(2*pi)).*e, SNR_index,Inf,'ArrayValued',true);
e must be defined as a function of SNR_index:
e = @(SNR_index)exp(-SNR_index.^2./2)
and the function to be integrated must be
@(SNR_index) (1/sqrt(2*pi)).*e(SNR_index)
The lower limit of integration (SNR_index) does not have a value. Maybe you want to define
compute_the_Q = @(xlow) integral(@(SNR_index) (1/sqrt(2*pi)).*e(SNR_index), xlow,Inf);
exact_P_e_AWGN(SNR_index) = log10(compute_the_Q(sqrt(2*SNR_per_bit_linear(SNR_index)))) ;
I don't know what you try to define here. We miss the function SNR_per_bit_linear. If SNR_index has a numerical value, you can just do
exact_P_e_AWGN = log10(compute_the_Q(sqrt(2*SNR_per_bit_linear(SNR_index)))) ;

Catégories

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by