Index out of bound error in Matlab code ...Plz help....
1 次查看(过去 30 天)
显示 更早的评论
Error is :- ??? Attempted to access N_all(2); index out of bounds because numel(N_all)=1.
Below is my code....
clc
clear all
close all
pause(0.05)
N_all=[100];
Eb_no=[0:2:20];
for ii=1:length(Eb_no)
N=N_all(ii)
end
2 个评论
Geoff Hayes
2015-4-12
Manish - you've initialized N_all as a scalar and yet your code is trying to use it as an array…and so the error messages makes sense. What are you attempting to do?
采纳的回答
Stalin Samuel
2015-4-12
clc
clear all
close all
pause(0.05)
N_all=[1:100];
Eb_no=[0:2:20];
for ii=1:length(Eb_no)
N=N_all(ii)
end
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!