I am working on obstacle avoidance and path following code. For which I have made different functions in matlab. My question when ever I run them it says "Not enough input arguments".Is this is the problem with Matlab software ,I am using R2017a.

code for obstacle drawing
function drawObstacles(obstacles)
if(~ isempty(obstacles))
plot(obstacles(:,1), obstacles(:,2), '.k'); %plot the obstacles
end

9 Comments

He is asking that how you call the function , can you show us how you are calling it?
For example, are you running this code by being in the editor displaying the code and pressing the green "Run" button?
You should not run a function file . Read the link below:
https://www.mathworks.com/help/matlab/ref/function.html
I you use the green run button, the default is to run the function without any inputs. So you should either use the dropdown under the run button to insert your variable, or you should write the code in a script or in the command windown.

Sign in to comment.

Answers (0)

Asked:

on 27 Aug 2018

Commented:

on 27 Aug 2018

Community Treasure Hunt

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

Start Hunting!