Too many output arguments.

10 views (last 30 days)
Jacob O. Otasowie
Jacob O. Otasowie on 8 Apr 2020
Commented: Srivardhan Gadila on 22 Apr 2020
Hello people, I need some help with the error below:
Error using SpringendBallsB04>groundHeight
Too many output arguments.
Error in SpringendBallsB04>impactMap (line ...)
[~,groundSlope] = groundHeight(horizPos);
Error in SpringendBallsB04 (line ...)
[IC, ballRolling]= impactMap(impactState,P); %This becomes the new start state
HERE IS A PART OF THE PROGRAM. THE FUNKTION CALLED impactMap BELOW THE MAIN CODE MIGHT BE THE PROBLEM.
I AM TRYING TO MAKE A 3D SIMULATION OUT OF A 2D CODE
PLEASE HELP ME
[code attached as a file by Madhan Ravi since it was too long]

Answers (1)

Srivardhan Gadila
Srivardhan Gadila on 11 Apr 2020
The function z = groundHeight(x,y) in line 314 has only one output argument z and two input arguments x & y. You are calling this function in line 379 inside the function [stateOut, ballRolling] = impactMap(stateIn,P) as
[~,groundSlope] = groundHeight(horizPos);
Change it to
groundSlope = groundHeight(horizPos,2ndInputArgument);
  5 Comments

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!