Too many output arguments.

조회 수: 10 (최근 30일)
Jacob O. Otasowie
Jacob O. Otasowie 2020년 4월 8일
댓글: Srivardhan Gadila 2020년 4월 22일
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]

답변 (1개)

Srivardhan Gadila
Srivardhan Gadila 2020년 4월 11일
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
Jacob O. Otasowie
Jacob O. Otasowie 2020년 4월 22일

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by