Index in position 2 exceeds array bounds (must not exceed 1).
1 view (last 30 days)
Show older comments
Hi, I am running a code, however I keep getting error:
Can anyone help me fix this issue? Thank you.
title('Orignal Image' )
plot(NouN(100,:) )
2 Comments
Adam Danz
on 5 Oct 2018
Nout is allocated with all 0s.
Nout=zeros(1,col);
Then in a loop, you do this calculation
for j = 1:col
...
Nout(1,j) = Nin(1,j)*exp(-A(1,j));
...
end
On each iteration of the loop, Nin(1,j) will always equal 0, no?
Answers (1)
the cyclist
on 5 Oct 2018
Edited: the cyclist
on 5 Oct 2018
I can't be sure, but it looks like you've inadvertently defined Nin to just be a scalar:
Nin(1,:)=100000
Nin =
100000
So if you try to access Nin(1,2), it does not exist.
0 Comments
See Also
Categories
Find more on Numeric Types in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!