Email: helpdesk@telkomuniversity.ac.id

This Portal for internal use only!

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • IBM
  • Visual Paradigm
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Categories
  • Microsoft
    • Microsoft Apps
    • Office
    • Operating System
    • VLS
    • Developer Tools
    • Productivity Tools
    • Database
    • AI + Machine Learning
    • Middleware System
    • Learning Services
    • Analytics
    • Networking
    • Compute
    • Security
    • Internet Of Things
  • Adobe
  • Matlab
  • Google
  • Visual Paradigm
  • WordPress
    • Plugin WP
    • Themes WP
  • Opensource
  • Others
More Categories Less Categories
  • Get Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • My Account
    • Download
    • Cart
    • Checkout
    • Login
  • About Us
    • Contact
    • Forum
    • Frequently Questions
    • Privacy Policy
  • Forum
    • News
      • Category
      • News Tag

iconTicket Service Desk

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • IBM
  • Visual Paradigm
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Menu
  • Home
    • Download Application Package Repository Telkom University
    • Application Package Repository Telkom University
    • Download Official License Telkom University
    • Download Installer Application Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • All Pack
    • Microsoft
      • Operating System
      • Productivity Tools
      • Developer Tools
      • Database
      • AI + Machine Learning
      • Middleware System
      • Networking
      • Compute
      • Security
      • Analytics
      • Internet Of Things
      • Learning Services
    • Microsoft Apps
      • VLS
    • Adobe
    • Matlab
    • WordPress
      • Themes WP
      • Plugin WP
    • Google
    • Opensource
    • Others
  • My account
    • Download
    • Get Pack
    • Cart
    • Checkout
  • News
    • Category
    • News Tag
  • Forum
  • About Us
    • Privacy Policy
    • Frequently Questions
    • Contact
Home/Matlab/I am calling outside functions for this code, but when I am getting an error saying I have too many output arguments. I think the error is within my function LandingDistance

I am calling outside functions for this code, but when I am getting an error saying I have too many output arguments. I think the error is within my function LandingDistance

PuTI / 2025-01-27
I am calling outside functions for this code, but when I am getting an error saying I have too many output arguments. I think the error is within my function LandingDistance
Matlab News

%% problem 2
% user-defined function to compute the horizontal distance
% traveled by a projectile knowing the launch angle, the initial velocity,
% and geometric parameters defining the initial coordinates of the projectile.
d1 = 0.0876;
d2 = 0.1190;
v0 = 3.2;
thetaL = 50;
g = 9.81; % gravitational acceleration in m/s^2

% call initial coords function and initial velocity function
[x0, y0] = InitialCoords(d1, d2, thetaL); % input units: m, m, degrees, output units: m
[v0x, v0y] = InitialVelocityComponents(v0, thetaL); % input units: m/s de,grees, output units: m/s

%Solve the y equation for tLand by calling your Quadratic function.
a = -0.5*g; % g = acceleration due to gravity in m/s^2
b = v0y; % initial velocity in y direction
c = y0; % initial y position
plusOrMinus = -1;
root = Quadratic(a, b, c, plusOrMinus); % neg root
tLand = root;

% plug tLand into the x eqn to get xLand
xLand = LandingDistance(d1, d2, v0, thetaL);
fprintf(‘For launch angle = %.1f degrees and v0 = %.1f m/s, the landing distance is %.2f m n’, thetaL, v0, xLand)

Error using LandingDistance
Too many output arguments.

Error in HW3_projectile (line 36)
xLand = LandingDistance(d1, d2, v0, thetaL);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_____________________________________
function code
% landing distance function
function LandingDistance(d1, d2, v0, thetaL)
% x_Land –> the horizontal distance traveled by the projectile
g = 9.81; % gravitational acceleration in m/s^2
[x0, y0] = InitialCoords(d1, d2, thetaL) % input units: m, m, degrees, output units: m
[v0x, v0y] = InitialVelocityComponents(v0, thetaL) % input units: m/s de,grees, output units: m/s
a = -0.5*g; % g = acceleration due to gravity in m/s^2
b = v0y; % initial velocity in y direction
c = y0; % initial y position
plusOrMinus = -1;
[root] = Quadratic(a, b, c, plusOrMinus); % neg root
tLand = root
xLand = x0 + (v0x*tLand)
end

Not enough input arguments.

Error in LandingDistance (line 6)
[x0, y0] = InitialCoords(d1, d2, thetaL)
^^

>>%% problem 2
% user-defined function to compute the horizontal distance
% traveled by a projectile knowing the launch angle, the initial velocity,
% and geometric parameters defining the initial coordinates of the projectile.
d1 = 0.0876;
d2 = 0.1190;
v0 = 3.2;
thetaL = 50;
g = 9.81; % gravitational acceleration in m/s^2

% call initial coords function and initial velocity function
[x0, y0] = InitialCoords(d1, d2, thetaL); % input units: m, m, degrees, output units: m
[v0x, v0y] = InitialVelocityComponents(v0, thetaL); % input units: m/s de,grees, output units: m/s

%Solve the y equation for tLand by calling your Quadratic function.
a = -0.5*g; % g = acceleration due to gravity in m/s^2
b = v0y; % initial velocity in y direction
c = y0; % initial y position
plusOrMinus = -1;
root = Quadratic(a, b, c, plusOrMinus); % neg root
tLand = root;

% plug tLand into the x eqn to get xLand
xLand = LandingDistance(d1, d2, v0, thetaL);
fprintf(‘For launch angle = %.1f degrees and v0 = %.1f m/s, the landing distance is %.2f m n’, thetaL, v0, xLand)

Error using LandingDistance
Too many output arguments.

Error in HW3_projectile (line 36)
xLand = LandingDistance(d1, d2, v0, thetaL);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_____________________________________
function code
% landing distance function
function LandingDistance(d1, d2, v0, thetaL)
% x_Land –> the horizontal distance traveled by the projectile
g = 9.81; % gravitational acceleration in m/s^2
[x0, y0] = InitialCoords(d1, d2, thetaL) % input units: m, m, degrees, output units: m
[v0x, v0y] = InitialVelocityComponents(v0, thetaL) % input units: m/s de,grees, output units: m/s
a = -0.5*g; % g = acceleration due to gravity in m/s^2
b = v0y; % initial velocity in y direction
c = y0; % initial y position
plusOrMinus = -1;
[root] = Quadratic(a, b, c, plusOrMinus); % neg root
tLand = root
xLand = x0 + (v0x*tLand)
end

Not enough input arguments.

Error in LandingDistance (line 6)
[x0, y0] = InitialCoords(d1, d2, thetaL)
^^

>> %% problem 2
% user-defined function to compute the horizontal distance
% traveled by a projectile knowing the launch angle, the initial velocity,
% and geometric parameters defining the initial coordinates of the projectile.
d1 = 0.0876;
d2 = 0.1190;
v0 = 3.2;
thetaL = 50;
g = 9.81; % gravitational acceleration in m/s^2

% call initial coords function and initial velocity function
[x0, y0] = InitialCoords(d1, d2, thetaL); % input units: m, m, degrees, output units: m
[v0x, v0y] = InitialVelocityComponents(v0, thetaL); % input units: m/s de,grees, output units: m/s

%Solve the y equation for tLand by calling your Quadratic function.
a = -0.5*g; % g = acceleration due to gravity in m/s^2
b = v0y; % initial velocity in y direction
c = y0; % initial y position
plusOrMinus = -1;
root = Quadratic(a, b, c, plusOrMinus); % neg root
tLand = root;

% plug tLand into the x eqn to get xLand
xLand = LandingDistance(d1, d2, v0, thetaL);
fprintf(‘For launch angle = %.1f degrees and v0 = %.1f m/s, the landing distance is %.2f m n’, thetaL, v0, xLand)

Error using LandingDistance
Too many output arguments.

Error in HW3_projectile (line 36)
xLand = LandingDistance(d1, d2, v0, thetaL);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_____________________________________
function code
% landing distance function
function LandingDistance(d1, d2, v0, thetaL)
% x_Land –> the horizontal distance traveled by the projectile
g = 9.81; % gravitational acceleration in m/s^2
[x0, y0] = InitialCoords(d1, d2, thetaL) % input units: m, m, degrees, output units: m
[v0x, v0y] = InitialVelocityComponents(v0, thetaL) % input units: m/s de,grees, output units: m/s
a = -0.5*g; % g = acceleration due to gravity in m/s^2
b = v0y; % initial velocity in y direction
c = y0; % initial y position
plusOrMinus = -1;
[root] = Quadratic(a, b, c, plusOrMinus); % neg root
tLand = root
xLand = x0 + (v0x*tLand)
end

Not enough input arguments.

Error in LandingDistance (line 6)
[x0, y0] = InitialCoords(d1, d2, thetaL)
^^

>> error, not enough inputs, too many outputs MATLAB Answers — New Questions

​

Tags: matlab

Share this!

Related posts

MATLAB Answers is provisionally back?
2025-05-21

MATLAB Answers is provisionally back?

Saveobj and Loadobj for arrays of objects
2025-05-21

Saveobj and Loadobj for arrays of objects

test one two three four
2025-05-20

test one two three four

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Categories

  • Matlab
  • Microsoft
  • News
  • Other
Application Package Repository Telkom University

Tags

matlab microsoft opensources
Application Package Download License

Application Package Download License

Adobe
Google for Education
IBM
Matlab
Microsoft
Wordpress
Visual Paradigm
Opensource

Sign Up For Newsletters

Be the First to Know. Sign up for newsletter today

Application Package Repository Telkom University

Portal Application Package Repository Telkom University, for internal use only, empower civitas academica in study and research.

Information

  • Telkom University
  • About Us
  • Contact
  • Forum Discussion
  • FAQ
  • Helpdesk Ticket

Contact Us

  • Ask: Any question please read FAQ
  • Mail: helpdesk@telkomuniversity.ac.id
  • Call: +62 823-1994-9941
  • WA: +62 823-1994-9943
  • Site: Gedung Panambulai. Jl. Telekomunikasi

Copyright © Telkom University. All Rights Reserved. ch

  • FAQ
  • Privacy Policy
  • Term

This Application Package for internal Telkom University only (students and employee). Chiers... Dismiss