ERROR: Array indices must be positive integers or logical values. Can anyone please help, Thank You!

1 view (last 30 days)
clc
clear all;
%Parameters defined
PsByN_0dB = 3;
PsByN_0=10.^(PsByN_0dB/10);
UmaxdB = 6.0;
UmaxN_0=10.^(UmaxdB/10);
Qu=[0.1:0.1:2];
QoS_Component_u=10.^(Qu);
for i=1:length(QoS_Component_u)
u=QoS_Component_u(i);
mui(i) = (1/u)*log((PsByN_0*u*exp(-PsByN_0*u)*(expint(PsByN_0*u(u*UmaxN_0+PsByN_0*u)+PsByN_0*u))-((exp(PsByN_0*u(u*UmaxN_0+PsByN_0*u))/(u*UmaxN_0+PsByN_0*u+1))))-(PsByN_0*u*exp(-PsByN_0*u)*(expint(PsByN_0*u(PsByN_0*u)+PsByN_0*u))-(exp(PsByN_0*u*(PsByN_0*u)))/(PsByN_0*u+1)));
end

Accepted Answer

Star Strider
Star Strider on 18 May 2022
I suspect the problem is with this term —
u(u*UmaxN_0+PsByN_0*u)
and everywhere else something similar to that is used. The value inside the parenthesis is likely not an integer greater than zero, or a logical value.
You will need to determine how best to solve that.

More Answers (0)

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!