MATLAB: Index out of bound error in Matlab code …Plz help….

index out of bound

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

Best Answer

  • 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