To solve this file it says (Attempted to access x(2); index out of bounds because numel(x)=1) Can any one of you please tell me whats the problem... Thank you !

I attached the m.file ..

1 Comment

Please format your code so that it is possible to read (copy it from matlab, paste it here, mark it and press the button "{} Code" above the text box.

Answers (1)

You have not given us any indication of what ngg will be, and you have not shown us any reason to expect that ngg is no larger than length(x)

This question is closed.

Asked:

on 6 Feb 2014

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!