how to overcome the error
2 次查看(过去 30 天)
显示 更早的评论
Bmax=2000000; %maximum available bandwidth for OFDMA
noise=1e-9; %fixed noise power is assumed
p_fix=0.01; %fixed transmit power is assumed
N_UE=[10 20 30 40 50 ];
N_SC=[60 70 80 90 100];
for it=1:2
for t= 1:length(N_UE)
for r = 1:length(N_SC)
throughput_E(t) = @(t) Bmax * log2(1 + p_fix(t)*gamma(t) / sum(p_fix(1:t-1) .* gamma(t) ));
overall_throughput_E(t) = sum(sum(throughput_E(t)));
output_E(t,r)=overall_throughput_E(t);
output_E(t)_it(t,r,it)=output_E(t,r);
end
end
end.
If i run the code i am getting
Error: File: Line: 12 Column: 12
The input character is not valid in MATLAB
statements or expressions.
0 个评论
采纳的回答
KSSV
2018-1-1
This line is not correct:
output_E(t)_it(t,r,it)=output_E(t,r);
You should change it to:
output_Et_it(t,r,it)=output_E(t,r);
4 个评论
Walter Roberson
2018-1-2
You define
p_fix=0.01; %fixed transmit power is assumed
which makes p_fix a scalar. But you are using p_fix(t) and p_fix(1:t-1) which assume that t is either empty or is exactly 1 or is true or false (otherwise you would be indexing outside the array.)
You are looping over it and t and r but your calculations do not use it or r so taking a 2D sum does not make any sense.
更多回答(1 个)
Walter Roberson
2018-1-1
Your code line is
output_E(t)_it(t,r,it)=output_E(t,r);
Underscore is not a valid character immediately after the (t)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Axis Labels 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!