Clear Filters
Clear Filters

how can i resolve it not enough input arguments?

1 view (last 30 days)
function demo(testdir, n, code)
for k = 1:n %getting error in it

Accepted Answer

Adam
Adam on 30 Jan 2017
Edited: Adam on 31 Jan 2017
Pass the right number of arguments in when you call it. Don't just hit the big green 'Run' button, call it from command line or a script or another function and pass in the arguments.
If you are calling it without arguments how would you expect it to know what n is and didn't you consider that you haven't been able to tell it what n is and that you want to?!
  2 Comments
Pooja Prajapati
Pooja Prajapati on 30 Jan 2017
actually i m using this code direct from sources available from internet,
so n fairly i m new here in matlab so i simply don't know how to run it exactly,
N so i didn't know what is n actually here?
That's the problem actually,
so expecting help please guide me here what is n here?
& what input arguments i have to give in command prompt?
thanks in adv.
Adam
Adam on 31 Jan 2017
I have no idea what the function is? But why are you running the function at all if you don't know what it does or what its inputs are supposed to be? I rarely download Matlab code from the internet for exactly this reason of not knowing what its inputs are supposed to be often.

Sign in to comment.

More Answers (0)

Categories

Find more on Interactive Control and Callbacks 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!